Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Fix flaky IrisMessageIntegrationTest #7317

Merged
merged 6 commits into from
Oct 7, 2023

Conversation

laadvo
Copy link
Contributor

@laadvo laadvo commented Oct 4, 2023

Checklist

General

Server

Motivation and Context

The test IrisMessageIntegrationTest.sendOneMessage is flaky with H2 on Bamboo and Github Actions. It sometimes fails with

org.mockito.exceptions.verification.NoInteractionsWanted: 
      No interactions wanted here:
       -> at de.tum.in.www1.artemis.iris.AbstractIrisIntegrationTest.verifyNothingElseWasSentOverWebsocket(AbstractIrisIntegrationTest.java:162)

This is due to the test sendTwoMessages(), which is run before sendOneMessage() 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 the websocketMessagingService.sendMessageToUser calls do no affect the test sendOneMessage() which comes after it. In addition, it removes the verifyNoMoreInteractions statements from tests, so that they do not fail in case an asynch notification is sent while they are run.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Test Coverage

unchanged

@laadvo laadvo marked this pull request as ready for review October 5, 2023 09:44
@laadvo laadvo requested a review from a team as a code owner October 5, 2023 09:44
@laadvo laadvo added the small label Oct 5, 2023
Copy link
Contributor

@DominikRemo DominikRemo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM, thanks for the fix 🚀

@laadvo laadvo added this to the 6.5.5 milestone Oct 5, 2023
@krusche krusche merged commit 9d2ce2c into develop Oct 7, 2023
27 of 30 checks passed
@krusche krusche deleted the development/fix-flaky-IrisMessageIntegrationTest branch October 7, 2023 15:45
@krusche krusche modified the milestones: 6.5.5, 6.6.0 Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants