From f8c3ae23ed6ada1bb8b024f7937ca03545bb78b8 Mon Sep 17 00:00:00 2001 From: Elephant Liu Date: Wed, 29 Nov 2023 14:24:34 +0800 Subject: [PATCH] unittest: wait for server quit (#123) --- 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