[SERVER-70045] RunChangeStreamsInBackground hook resets the global PRNG state Created: 28/Sep/22  Updated: 29/Oct/23  Resolved: 05/Oct/22

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

Type: Bug Priority: Minor - P4
Reporter: Max Hirschhorn Assignee: Jennifer Peshansky (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-55859 Add multiversion full cluster changes... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2022-10-31
Participants:

 Description   

The seed has already been set earlier in resmoke. Reusing the same sequence of pseudo-random bits as the ones used to shuffle the order of test execution seems like an accident.

class RunChangeStreamsInBackground(interface.Hook):
    """A hook to run change streams in the background."""
 
    IS_BACKGROUND = True
 
    def __init__(self, hook_logger, fixture):
        """Initialize RunChangeStreamsInBackground."""
        description = (
            "Run in the background full cluster change streams while a test is running."
            " Open and close the change stream every 1..10 tests (random using config.RANDOM_SEED)."
        )
        interface.Hook.__init__(self, hook_logger, fixture, description)
        self._fixture = fixture
        self._change_streams_thread = None
        self._test_run = None
        random.seed(config.RANDOM_SEED)
        self._every_n_tests = random.randint(1, 10)
        self._full_suite_changes_num = 0

https://github.com/mongodb/mongo/blob/08cb7afe3cbc66cd07dd3ca645f965b3adc5edda/buildscripts/resmokelib/testing/hooks/change_streams.py#L27



 Comments   
Comment by Githook User [ 05/Oct/22 ]

Author:

{'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}

Message: SERVER-70045 Do not re-set the random seed
Branch: master
https://github.com/mongodb/mongo/commit/493be29d4ea71b3396f0f4373f56c54e0f4dd7fe

Generated at Thu Feb 08 06:15:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.