Development
: Fix flaky IrisMessageIntegrationTest
#7317
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.
Checklist
General
Server
Motivation and Context
The test
IrisMessageIntegrationTest.sendOneMessage
is flaky with H2 on Bamboo and Github Actions. It sometimes fails withThis is due to the test
sendTwoMessages()
, which is run beforesendOneMessage()
sends 4 messages in asynch.These count as unverified interractions with the mock and sometimes happen exactly when no interractions are wanted, causing
verifyNoMoreInteractions(websocketMessagingService)
to fail.Additionally, we have some tests related to group notifications and when the release or assessament due date of an exercise is reached, a notification is sent. This can occur while
sendOneMessage
is run, resulting in unverified interractions with the same mock.Description
This PR adds a verify statement at the end of
sendTwoMessages()
, making sure that thewebsocketMessagingService.sendMessageToUser
calls do no affect the testsendOneMessage()
which comes after it. In addition, it removes theverifyNoMoreInteractions
statements from tests, so that they do not fail in case an asynch notification is sent while they are run.Review Progress
Code Review
Test Coverage
unchanged