aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/test/mnesia_atomicity_test.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-12-06 15:47:54 +0100
committerDan Gudmundsson <[email protected]>2011-12-06 15:49:52 +0100
commit8bce2d5a342bda12aad6607312e3796a37d7c8eb (patch)
tree7779d955032416e1af00c968907030c9cb967277 /lib/mnesia/test/mnesia_atomicity_test.erl
parente166ed9661944a951ca0a2828d04e7141414dfa1 (diff)
downloadotp-8bce2d5a342bda12aad6607312e3796a37d7c8eb.tar.gz
otp-8bce2d5a342bda12aad6607312e3796a37d7c8eb.tar.bz2
otp-8bce2d5a342bda12aad6607312e3796a37d7c8eb.zip
[mnesia] Fixed sticky read lock bug
wread on locks stuck at non-local node could return unexpected value. Thanks to Magnus Henoch who posted a nice testcase showing the bug.
Diffstat (limited to 'lib/mnesia/test/mnesia_atomicity_test.erl')
-rw-r--r--lib/mnesia/test/mnesia_atomicity_test.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl
index 39fb7d4642..06c4d16d71 100644
--- a/lib/mnesia/test/mnesia_atomicity_test.erl
+++ b/lib/mnesia/test/mnesia_atomicity_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -535,8 +535,10 @@ start_lock_waiter(BlockOpA, BlockOpB, Config) ->
BlockOpA == rt, BlockOpB /= sw -> 1;
true -> 2
end,
- ?match_multi_receive([{'EXIT', A, {atomic, ExpectedCounter}},
- {'EXIT', B, killed}]),
+ receive {'EXIT', B, _} -> ok
+ after 3000 -> ?error("Timeout~n", []) end,
+ receive {'EXIT', A, Exp1} -> ?match({atomic, ExpectedCounter}, Exp1)
+ after 3000 -> ?error("Timeout~n", []) end,
%% the expected result depends on the transaction of
%% fun A - when that doesn't change the object in the