File tree 1 file changed +7
-4
lines changed
v-next/hardhat/test/internal/cli/telemetry
1 file changed +7
-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,15 @@ 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
+ resolve ( true ) ;
40
+ } catch ( _err ) { }
38
41
} else if ( counter > MAX_COUNTER ) {
39
42
clearInterval ( intervalId ) ;
40
43
reject ( "Subprocess was not executed in the expected time" ) ;
41
44
}
42
- } , 100 ) ;
45
+ } , 50 ) ;
43
46
} ) ;
44
47
}
You can’t perform that action at this time.
0 commit comments