@@ -20,16 +20,25 @@ describe('test/index.v2.test.js', () => {
2020 let cwd ;
2121
2222 afterEach ( async ( ) => {
23- await clean ( { cwd } ) ;
23+ try {
24+ await clean ( { cwd, daemon : true } ) ;
25+ } catch ( e ) {
26+ console . warn ( 'clean error: ' , e ) ;
27+ }
2428 if ( process . platform === 'darwin' ) {
2529 try {
2630 await forceExitDaemon ( ) ;
2731 } catch ( err ) {
2832 console . warn ( 'force exit daemon error: %s' , err . message ) ;
2933 }
3034 } else {
31- await exitDaemon ( ) ;
35+ try {
36+ await exitDaemon ( ) ;
37+ } catch ( err ) {
38+ console . warn ( 'exit daemon error: %s' , err . message ) ;
39+ }
3240 }
41+
3342 } ) ;
3443
3544 describe ( 'update' , ( ) => {
@@ -223,9 +232,8 @@ describe('test/index.v2.test.js', () => {
223232 assert . strictEqual ( dirs . filter ( dir => dir . includes ( 'esbuild' ) ) . length , 2 ) ;
224233 await assert . doesNotReject ( fs . stat ( path . join ( cwd , 'node_modules/esbuild' ) ) ) ;
225234 assert . strictEqual ( require ( path . join ( cwd , 'node_modules' , 'esbuild/package.json' ) ) . version , '0.15.14' ) ;
226- const nodeModulesDir = path . join ( cwd , 'node_modules' ) ;
227235
228- await execa . command ( `umount -f ${ nodeModulesDir } ` ) ;
236+ await execa . command ( 'killall -9 nydusd' ) ;
229237 await setTimeoutPromise ( 20000 ) ;
230238 assert . strictEqual ( require ( path . join ( cwd , 'node_modules' , 'esbuild/package.json' ) ) . version , '0.15.14' ) ;
231239 } ) ;
@@ -248,9 +256,8 @@ describe('test/index.v2.test.js', () => {
248256 assert . strictEqual ( dirs . filter ( dir => dir . includes ( 'esbuild' ) ) . length , 2 ) ;
249257 await assert . doesNotReject ( fs . stat ( path . join ( cwd , 'node_modules/esbuild' ) ) ) ;
250258 assert . strictEqual ( require ( path . join ( cwd , 'node_modules' , 'esbuild/package.json' ) ) . version , '0.15.14' ) ;
251- const nodeModulesDir = path . join ( cwd , 'node_modules' ) ;
252259
253- await execa . command ( `umount -f ${ nodeModulesDir } ` ) ;
260+ await execa . command ( 'killall -9 nydusd' ) ;
254261 await setTimeoutPromise ( 20000 ) ;
255262
256263 await assert . rejects ( fs . stat ( path . join ( cwd , 'node_modules' , 'esbuild/package.json' ) ) ) ;
0 commit comments