From e749b052cf994e62789e635dc9e3449c0bc01bf5 Mon Sep 17 00:00:00 2001 From: Elephant Liu Date: Wed, 29 Nov 2023 13:14:58 +0800 Subject: [PATCH] unittest: wait for server quit --- tests/shabby/reconnect_delay.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/shabby/reconnect_delay.py b/tests/shabby/reconnect_delay.py index e85c109e..3d56bff1 100644 --- a/tests/shabby/reconnect_delay.py +++ b/tests/shabby/reconnect_delay.py @@ -44,6 +44,12 @@ def test_hard_server_error(): assert mc.set('foo', 1) memcached_server_ctl('stop', normal_port) + + # I dont know why, + # but the server is still connectable after stop. + # add a sleep to wait for the server quit + time.sleep(3) + assert not mc.set('foo', 1) # fail memcached_server_ctl('start', normal_port) assert not mc.set('foo', 1) # still fail