diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-10-14 23:14:52 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-10-14 23:14:52 +0100 |
| commit | 10db9f9de5b4a7ee082b431f7b04cf39fb04ff6f (patch) | |
| tree | 18a879b43bcf0a81dae076cd0a98defdbda2fd15 | |
| parent | cc564c8bcc0c916d65bbf306fd5ba03d6421cd29 (diff) | |
| download | rabbitmq-server-git-10db9f9de5b4a7ee082b431f7b04cf39fb04ff6f.tar.gz | |
improve code coverage
this gets us close to the same coverage as 'default'. One notable
exception is dying-client elimination of 'remove', which is proving
rather elusive.
| -rw-r--r-- | src/rabbit_tests.erl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rabbit_tests.erl b/src/rabbit_tests.erl index 5e034ae7df..82a4c39796 100644 --- a/src/rabbit_tests.erl +++ b/src/rabbit_tests.erl @@ -1920,7 +1920,7 @@ foreach_with_msg_store_client(MsgStore, Ref, Fun, L) -> test_msg_store() -> restart_msg_store_empty(), MsgIds = [msg_id_bin(M) || M <- lists:seq(1,100)], - {MsgIds1stHalf, MsgIds2ndHalf} = lists:split(50, MsgIds), + {MsgIds1stHalf, MsgIds2ndHalf} = lists:split(length(MsgIds) div 2, MsgIds), Ref = rabbit_guid:guid(), {Cap, MSCState} = msg_store_client_init_capture( ?PERSISTENT_MSG_STORE, Ref), @@ -2038,6 +2038,8 @@ test_msg_store() -> false = msg_store_contains(false, MsgIdsBig, MSCStateM), MSCStateM end), + %% + passed = test_msg_store_client_delete_and_terminate(), %% restart empty restart_msg_store_empty(), passed. @@ -2071,6 +2073,16 @@ test_msg_store_confirms(MsgIds, Cap, MSCState) -> ok = on_disk_await(Cap, MsgIds), passed. +test_msg_store_client_delete_and_terminate() -> + restart_msg_store_empty(), + MsgIds = [msg_id_bin(1)], + Ref = rabbit_guid:guid(), + MSCState = msg_store_client_init(?PERSISTENT_MSG_STORE, Ref), + ok = msg_store_write(MsgIds, MSCState), + %% test the 'dying client' fast path for writes + ok = rabbit_msg_store:client_delete_and_terminate(MSCState), + passed. + queue_name(Name) -> rabbit_misc:r(<<"/">>, queue, Name). |
