Skip to content

Commit 978bc0e

Browse files
authored
Fix test_lifecycle_listener_receives_disconnected_event (#417)
This test failed in Github Actions runners. The reason of the failure is that, we try to check the received events right after shutting down the member. It might be the case that, the member is shutdown, but it is not visible to the client yet. To tackle that, we now use `assertTrueEventually` to verify that we receive the event.
1 parent f2097d8 commit 978bc0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/integration/backward_compatible/lifecycle_test.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ def test_lifecycle_listener_receives_disconnected_event(self):
6767
)
6868
client.lifecycle_service.add_listener(collector)
6969
member.shutdown()
70-
self.assertEqual(collector.events, [LifecycleState.DISCONNECTED])
70+
71+
def assertion():
72+
self.assertEqual(collector.events, [LifecycleState.DISCONNECTED])
73+
74+
self.assertTrueEventually(assertion)
75+
7176
client.shutdown()
7277

7378
def test_remove_lifecycle_listener(self):

0 commit comments

Comments
 (0)