File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -4024,11 +4024,23 @@ describe("PubSub", () => {
40244024 pubSub ,
40254025 ) ;
40264026
4027- // Test pubsubChannels
4028- const regularChannels = await client2 . pubsubChannels ( ) ;
4029- expect ( regularChannels ) . toEqual ( [ regularChannel ] ) ;
4027+ {
4028+ // Wait up to 3 seconds (60 * 50ms)
4029+ for ( let i = 0 ; i < 60 ; i ++ ) {
4030+ const channels = await client2 . pubsubChannels ( ) ;
4031+
4032+ if ( channels . includes ( regularChannel ) ) {
4033+ break ;
4034+ }
4035+
4036+ await new Promise ( ( r ) => setTimeout ( r , 50 ) ) ;
4037+ }
4038+
4039+ // Final assertion
4040+ const regularChannels = await client2 . pubsubChannels ( ) ;
4041+ expect ( regularChannels ) . toEqual ( [ regularChannel ] ) ;
4042+ }
40304043
4031- // Test pubsubShardchannels
40324044 const shardChannels = await (
40334045 client2 as GlideClusterClient
40344046 ) . pubsubShardChannels ( ) ;
You can’t perform that action at this time.
0 commit comments