@@ -371,7 +371,9 @@ describe('WorkdirContextPool', function() {
371
371
372
372
describe ( 'cross-instance cache invalidation' , function ( ) {
373
373
it ( 'invalidates a config cache key in different instances when a global setting is changed' , async function ( ) {
374
- const value = String ( Date . now ( ) ) ;
374
+ const base = String ( Date . now ( ) ) ;
375
+ const value0 = `${ base } -0` ;
376
+ const value1 = `${ base } -1` ;
375
377
376
378
const repo0 = pool . add ( await cloneRepository ( 'three-files' ) ) . getRepository ( ) ;
377
379
const repo1 = pool . add ( await cloneRepository ( 'three-files' ) ) . getRepository ( ) ;
@@ -383,17 +385,27 @@ describe('WorkdirContextPool', function() {
383
385
[ repo0 , repo1 , repo2 ] . map ( repo => repo . getConfig ( 'atomGithub.test' ) ) ,
384
386
) ;
385
387
386
- assert . notInclude ( [ before0 , before1 , before2 ] , value ) ;
388
+ assert . notInclude ( [ before0 , before1 , before2 ] , value0 ) ;
387
389
388
- await repo2 . setConfig ( 'atomGithub.test' , value , { global : true } ) ;
390
+ await repo2 . setConfig ( 'atomGithub.test' , value0 , { global : true } ) ;
389
391
390
392
const [ after0 , after1 , after2 ] = await Promise . all (
391
393
[ repo0 , repo1 , repo2 ] . map ( repo => repo . getConfig ( 'atomGithub.test' ) ) ,
392
394
) ;
393
395
394
- assert . strictEqual ( after0 , value ) ;
395
- assert . strictEqual ( after1 , value ) ;
396
- assert . strictEqual ( after2 , value ) ;
396
+ assert . strictEqual ( after0 , value0 ) ;
397
+ assert . strictEqual ( after1 , value0 ) ;
398
+ assert . strictEqual ( after2 , value0 ) ;
399
+
400
+ await repo0 . setConfig ( 'atomGithub.test' , value1 , { global : true } ) ;
401
+
402
+ const [ final0 , final1 , final2 ] = await Promise . all (
403
+ [ repo0 , repo1 , repo2 ] . map ( repo => repo . getConfig ( 'atomGithub.test' ) ) ,
404
+ ) ;
405
+
406
+ assert . strictEqual ( final0 , value1 ) ;
407
+ assert . strictEqual ( final1 , value1 ) ;
408
+ assert . strictEqual ( final2 , value1 ) ;
397
409
} ) ;
398
410
} ) ;
399
411
} ) ;
0 commit comments