Fix timing-related test failure in SessionsProseTest #1325
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are two tests in AbstractSessionsProseTest that rely on a running mongocryptd process. Each test starts and destroys the process, and it appears that occasionally the destruction in the first test interferes with the starting in the second test, and the second test fails to connect to the mongocryptd process.
This commit attempts to work around this by starting a single mongocryptd process and use it for both tests. Note that AbstractSessionsProseTest has two subclasses and therefore the mongocryptd process is still actually started and destroyed twice, it doesn't seem to be a problem in practice because the two subclasses are in different modules and there is enough time between their execution that there is interference.
JAVA-4998
Note: I ran a patch build of the 40 4.2+ standalone tasks (because they run the fastest) four times, and observed no failures of the test in question in any of them.