diff --git a/tests/iotests/mock-environment.cc b/tests/iotests/mock-environment.cc index fa1473f..345ffd3 100644 --- a/tests/iotests/mock-environment.cc +++ b/tests/iotests/mock-environment.cc @@ -43,6 +43,15 @@ void MockEnvironment::Reset() } } +void MockEnvironment::Stop() +{ + if (instance != NULL && instance->mock != NULL) { + shutdown_mock_server(instance->mock); + instance->mock = NULL; + } +} + + void MockEnvironment::init() { mock = NULL; diff --git a/tests/iotests/mock-environment.h b/tests/iotests/mock-environment.h index b9dd651..9e512d2 100644 --- a/tests/iotests/mock-environment.h +++ b/tests/iotests/mock-environment.h @@ -239,6 +239,7 @@ public: static MockEnvironment *getInstance(void); static void Reset(); + static void Stop(); /** * Make a connect structure you may utilize to connect to diff --git a/tests/iotests/t_get.cc b/tests/iotests/t_get.cc index 871574a..0e8638f 100644 --- a/tests/iotests/t_get.cc +++ b/tests/iotests/t_get.cc @@ -107,6 +107,8 @@ TEST_F(GetUnitTest, testGetHit) storeKey(instance, "testGetKey1", "foo"); storeKey(instance, "testGetKey2", "foo"); + MockEnvironment::Stop(); + usleep(100000); // wait for the mock to stop (100ms) lcb_get_cmd_t cmd1("testGetKey1"); lcb_get_cmd_t cmd2("testGetKey2"); lcb_get_cmd_t *cmds[] = { &cmd1, &cmd2 };