diff options
author | Dan Gudmundsson <[email protected]> | 2015-09-16 11:46:33 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2015-09-16 11:46:33 +0200 |
commit | e23ea97d7dce3c12f54f06cb90354a0b3a55d073 (patch) | |
tree | 69cd423074ce66091812204a95d2a41d2a39e2cf /lib/mnesia/test/mnesia_dirty_access_test.erl | |
parent | f0841ed29c96220d1a7c0b2ce7fa19795ec20816 (diff) | |
parent | 027726da70f31541bd3c4813bf464489a808ae91 (diff) | |
download | otp-e23ea97d7dce3c12f54f06cb90354a0b3a55d073.tar.gz otp-e23ea97d7dce3c12f54f06cb90354a0b3a55d073.tar.bz2 otp-e23ea97d7dce3c12f54f06cb90354a0b3a55d073.zip |
Merge branch 'dgud/mnesia/index-timing/OTP-12972' into maint
* dgud/mnesia/index-timing/OTP-12972:
mnesia: Improve index updates
Diffstat (limited to 'lib/mnesia/test/mnesia_dirty_access_test.erl')
-rw-r--r-- | lib/mnesia/test/mnesia_dirty_access_test.erl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl index 89aff2b3b8..0d57e5a1b1 100644 --- a/lib/mnesia/test/mnesia_dirty_access_test.erl +++ b/lib/mnesia/test/mnesia_dirty_access_test.erl @@ -401,9 +401,26 @@ dirty_index_read(Config, Storage) -> ?match({'EXIT', _}, mnesia:dirty_index_read(Tab, 2, BadValPos)), ?match({'EXIT', _}, mnesia:dirty_index_read(foo, 2, ValPos)), ?match({'EXIT', _}, mnesia:dirty_index_read([], 2, ValPos)), - + + mnesia:dirty_write({Tab, 5, 1}), + ?match(ok, index_read_loop(Tab, 0)), + ?verify_mnesia(Nodes, []). + +index_read_loop(Tab, N) when N =< 1000 -> + spawn_link(fun() -> + mnesia:transaction(fun() -> mnesia:write({Tab, 5, 1}) end) + end), + case mnesia:dirty_match_object({Tab, '_', 1}) of + [{Tab, 5, 1}] -> + index_read_loop(Tab, N+1); + Other -> {N, Other} + end; +index_read_loop(_, _) -> + ok. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |