[SERVER-26261] MongoRunner.versionIterator.iterator.toString() should not advance the iterator Created: 22/Sep/16  Updated: 19/Nov/16  Resolved: 09/Nov/16

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.4.0-rc3

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Max Hirschhorn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-25158 Prevent a 3.2 mongos from joining a f... Closed
Backwards Compatibility: Minor Change
Sprint: TIG 2016-10-31, TIG 2016-11-21
Participants:

 Description   

MongoRunner.versionIterator is a way to express that a test should be run for multiple binVersions. It currently exposes a single method called toString() which both gets the current value of the iterator and advances it. Instead, it should have separate peek() and next() methods for reading and advancing the value respectively.

This is important because it is easy to subtly break a test in the multiVersion suite by calling toString() on the iterator. This advances the iterator and causes MongoRunner to later launch the wrong version.

After this is fixed, we should be able to re-enable the following tests:

  • jstests/multiVersion/2_test_launching_cluster.js
  • jstests/multiVersion/dumprestore_sharded.js


 Comments   
Comment by Githook User [ 09/Nov/16 ]

Author:

{u'username': u'visemet', u'name': u'Max Hirschhorn', u'email': u'max.hirschhorn@mongodb.com'}

Message: SERVER-26261 Expose current() and advance() methods on version iterator.
Branch: master
https://github.com/mongodb/mongo/commit/6359f80037d38c3d342543822550d7350aa91ee7

Comment by Esha Maharishi (Inactive) [ 27/Sep/16 ]

just happened to notice this: https://github.com/mongodb/mongo/blob/3.3.12/src/mongo/shell/servers.js#L122-L125

Generated at Thu Feb 08 04:11:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.