diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2014-03-17 16:53:32 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2014-03-18 12:20:17 -0400 |
commit | 7497c50db07a987530e1f80cf0930b85494ec20d (patch) | |
tree | 561781a6f8a74f1e99a198f75aac8bb53b8b71ac | |
parent | 72e9bea86f89097fb65b9d392230235069302e96 (diff) | |
download | mongo-7497c50db07a987530e1f80cf0930b85494ec20d.tar.gz |
SERVER-13262 have mr_drop.js run on a unique DB to avoid parallel test failures
(cherry picked from commit 934c77bf4bc269ef53de4bc5b9b5046b13d1bed5)
-rw-r--r-- | jstests/mr_drop.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/jstests/mr_drop.js b/jstests/mr_drop.js index 8c4f9f8846f..3fdd99460dd 100644 --- a/jstests/mr_drop.js +++ b/jstests/mr_drop.js @@ -1,6 +1,10 @@ // Drop a collection while a map/reduce job is running against it. SERVER-6757 -t = db.jstests_mr_drop; +// Use a different DB to prevent other tests from breaking this race-y test when run in parallel. +// Formerly another test could take out a write lock on the DB, preventing map/reduce and drop() +// from running until the other action completed. When the other action completed, the drop thread +// was finished sleeping and ready to drop and would drop before map/reduce was able to start. +t = db.getSiblingDB('MrDrop').jstests_mr_drop; t.drop(); Random.setRandomSeed(); @@ -21,7 +25,7 @@ for( i = 0; i < 10000; ++i ) { db.getLastError(); // Schedule a collection drop two seconds in the future. -s = startParallelShell( "sleep( 2000 ); db.jstests_mr_drop.drop();" ); +s = startParallelShell( "sleep( 2000 ); db.getSiblingDB('MrDrop').jstests_mr_drop.drop();" ); // Run the map/reduce job. Check for command failure internally. The job succeeds even if the // source collection is dropped in progress. |