From e45ec90f0713011de66686fc453ea233816a3f76 Mon Sep 17 00:00:00 2001 From: Elephant Liu Date: Wed, 29 Nov 2023 14:24:17 +0800 Subject: [PATCH 1/3] unittest: fix no pickle (#121) --- tests/test_cmemcached_regression.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_cmemcached_regression.py b/tests/test_cmemcached_regression.py index 039a1fbc..908f0978 100644 --- a/tests/test_cmemcached_regression.py +++ b/tests/test_cmemcached_regression.py @@ -39,6 +39,9 @@ class NoPickle(object): def __getattr__(self, name): pass + def __getstate__(self): + raise Exception('can not be pickled') + class CmemcachedRegressionCase(unittest.TestCase): From f8c3ae23ed6ada1bb8b024f7937ca03545bb78b8 Mon Sep 17 00:00:00 2001 From: Elephant Liu Date: Wed, 29 Nov 2023 14:24:34 +0800 Subject: [PATCH 2/3] 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 From 9522d8acce9c3af8ebc57e50cb9dca8bf1155dd0 Mon Sep 17 00:00:00 2001 From: Elephant Liu Date: Wed, 29 Nov 2023 14:24:53 +0800 Subject: [PATCH 3/3] cppcheck: add more suppressions (#124) --- misc/.cppcheck-supp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/misc/.cppcheck-supp b/misc/.cppcheck-supp index 5b2f1453..5a2e13ef 100644 --- a/misc/.cppcheck-supp +++ b/misc/.cppcheck-supp @@ -1,10 +1,14 @@ +*:include/rapidjson/itoa.h:141 +*:include/rapidjson/itoa.h:216 *:include/llvm/SmallVector.h:55 *:include/llvm/SmallVector.h:88 *:include/llvm/SmallVector.h:134 *:include/llvm/SmallVector.h:162 +*:include/llvm/SmallVector.h:164 *:include/llvm/SmallVector.h:214 *:include/llvm/SmallVector.h:515 *:include/llvm/SmallVector.h:516 +*:include/llvm/SmallVector.h:546 *:include/llvm/SmallVector.h:715 *:include/llvm/SmallVector.h:718 *:include/llvm/SmallVector.h:726