summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2015-12-21 12:53:34 -0500
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2015-12-21 12:53:34 -0500
commit1dfd2cffcf1dc0cc49fe37e0f98daf8d464e0a5e (patch)
tree93c0b7171dfdbb516b413ec4cc2ae930ea25e8fc
parentdab123e614e64a0dcd4163415dd48532b1a79242 (diff)
downloadmongo-1dfd2cffcf1dc0cc49fe37e0f98daf8d464e0a5e.tar.gz
SERVER-21835 Ignore errors due to CappedPositionLost in make_capped.js.
(cherry picked from commit 9736f7439eda1f6a7856c535683fda239be86e04)
-rw-r--r--jstests/concurrency/fsm_workload_modifiers/make_capped.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/concurrency/fsm_workload_modifiers/make_capped.js b/jstests/concurrency/fsm_workload_modifiers/make_capped.js
index d17f291faa6..abe6ebc8264 100644
--- a/jstests/concurrency/fsm_workload_modifiers/make_capped.js
+++ b/jstests/concurrency/fsm_workload_modifiers/make_capped.js
@@ -35,6 +35,14 @@ function makeCapped($config, $super) {
// failures due to collection truncation
globalAssertLevel = AssertLevel.ALWAYS;
$super.states.find.apply(this, arguments);
+ } catch (e) {
+ if (e.message.indexOf('CappedPositionLost') >= 0) {
+ // Ignore errors when a cursor's position in the capped collection is deleted.
+ // Reads from the beginning of a capped collection are not guaranteed to succeed
+ // when there are concurrent inserts that cause a truncation.
+ return;
+ }
+ throw e;
} finally {
globalAssertLevel = oldAssertLevel;
}