File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
const http = require ( 'http' ) ;
3
- const { spawn, spawnSync } = require ( 'child_process' ) ;
3
+ const { spawn } = require ( 'child_process' ) ;
4
4
5
5
const makeTestPackage = require ( './make-test-package' ) ;
6
6
@@ -16,7 +16,8 @@ const Timeouts = {
16
16
PollInterval : 100 ,
17
17
BeforeSendingSigUsr1 : 2000 ,
18
18
DebuggerConnect : 3000 ,
19
- SelfExit : 6000
19
+ SelfExit : 6000 ,
20
+ FileIsBusyRetry : 1000
20
21
} ;
21
22
22
23
let env ;
@@ -152,8 +153,17 @@ describe('patch', () => {
152
153
default :
153
154
throw new Error ( `Platform ${ process . platform } is not supported` ) ;
154
155
}
155
- console . log ( 'processes' , spawnSync ( 'ps' , [ 'ax' ] ) . stdout . toString ( 'utf8' ) ) ;
156
- return patch ( { path : packagePath } ) ;
156
+ for ( let i = 0 ; i < 10 ; i ++ ) {
157
+ try {
158
+ return patch ( { path : packagePath } ) ;
159
+ } catch ( ex ) {
160
+ if ( ex . toString ( ) . includes ( 'text file is busy' ) ) {
161
+ await sleep ( Timeouts . FileIsBusyRetry ) ;
162
+ continue ;
163
+ }
164
+ throw ex ;
165
+ }
166
+ }
157
167
} ) ;
158
168
159
169
test ( 'no args' , async ( ) => {
You can’t perform that action at this time.
0 commit comments