File tree 1 file changed +6
-4
lines changed
v-next/hardhat/test/internal/cli/telemetry
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
import path from "node:path" ;
2
2
3
- import { exists } from "@ignored/hardhat-vnext-utils/fs" ;
3
+ import { exists , readUtf8File } from "@ignored/hardhat-vnext-utils/fs" ;
4
4
5
5
export const ROOT_PATH_TO_FIXTURE : string = path . join (
6
6
process . cwd ( ) ,
@@ -33,12 +33,14 @@ export async function checkIfSubprocessWasExecuted(
33
33
counter ++ ;
34
34
35
35
if ( await exists ( resultFilePath ) ) {
36
- clearInterval ( intervalId ) ;
37
- resolve ( true ) ;
36
+ try {
37
+ await readUtf8File ( resultFilePath ) ; // Wait for the file to be readable
38
+ clearInterval ( intervalId ) ;
39
+ } catch ( _err ) { }
38
40
} else if ( counter > MAX_COUNTER ) {
39
41
clearInterval ( intervalId ) ;
40
42
reject ( "Subprocess was not executed in the expected time" ) ;
41
43
}
42
- } , 100 ) ;
44
+ } , 50 ) ;
43
45
} ) ;
44
46
}
You can’t perform that action at this time.
0 commit comments