@@ -320,7 +320,7 @@ test.group('Bus synchronization', () => {
320320 assert . deepEqual ( result , 'bar' )
321321 } )
322322
323- test ( 'binary encoding/decoding should works fine' , async ( { assert, cleanup } , done ) => {
323+ test ( 'binary encoding/decoding should work fine' , async ( { assert, cleanup } , done ) => {
324324 const bus1 = redisBusDriver ( { connection : REDIS_CREDENTIALS } )
325325 . factory ( null as any )
326326 . setId ( 'foo' )
@@ -383,7 +383,7 @@ test.group('Bus synchronization', () => {
383383 . waitForDone ( )
384384 . disableTimeout ( )
385385
386- test ( 'works with utf8 characters' , async ( { assert } , done ) => {
386+ test ( 'works with utf8 characters' , async ( { assert, cleanup } , done ) => {
387387 const bus1 = redisBusDriver ( { connection : REDIS_CREDENTIALS } )
388388 . factory ( null as any )
389389 . setId ( 'foo' )
@@ -392,6 +392,11 @@ test.group('Bus synchronization', () => {
392392 . factory ( null as any )
393393 . setId ( 'bar' )
394394
395+ cleanup ( async ( ) => {
396+ await bus1 . disconnect ( )
397+ await bus2 . disconnect ( )
398+ } )
399+
395400 const data = {
396401 keys : [ 'foo' , '1' , '2' , 'bar' , 'key::test' , '🚀' ] ,
397402 type : CacheBusMessageType . Set ,
@@ -406,10 +411,6 @@ test.group('Bus synchronization', () => {
406411
407412 await bus2 . publish ( 'foo' , data )
408413
409- await bus1 . disconnect ( )
410-
411- await bus2 . disconnect ( )
412-
413414 await sleep ( 200 )
414415 } ) . waitForDone ( )
415416
0 commit comments