Robustify max_time_ms_sharded.js

XMLWordPrintableJSON

    • Fully Compatible
    • 40
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      In recent test runs on some of our slowest test infrastructure (the variant which collects code coverage), this assertion has been failing:

      max_time_ms_sharded.js:97
          // Positive test. ~10s operation, 2s limit. The operation takes ~10s because each shard
          // processes 25 batches of ~400ms each, and the shards are processing getMores in parallel.
          cursor = coll.find({
              $where: function() {
                  sleep(200);
                  return true;
              }
          });
          cursor.batchSize(2);
          cursor.maxTimeMS(2 * 1000);
          assert.doesNotThrow(
              () => cursor.next(), [], "did not expect mongos to time out first batch of query");
          assert.throws(() => cursor.itcount(), [], "expected mongos to abort getmore due to time limit");
      

      We can write a more robust test case which verifies the same thing, so we should do so.

            Assignee:
            Charlie Swanson
            Reporter:
            Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: