-
Notifications
You must be signed in to change notification settings - Fork 297
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 PostIntegrationTest
#7205
Conversation
Development
: Fix PostIntegrationTestDevelopment
: Fix flaky PostIntegrationTest
…est' into development/fix-PostIntegrationTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. Test succeeds locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
thanks a lot for figuring this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
Checklist
General
Server
Motivation and Context
The test
PostIntegrationTest.testGetPostsForCourse_WithExerciseIdRequestParam()
is flaky and sometimes fails withThis PR fixes the test
testCreateAnnouncement()
which is executed beforetestGetPostsForCourse_WithExerciseIdRequestParam()
and is causing it to be fail.Description
In the test
PostIntegrationTest.testCreateAnnouncement()
mails are sent using thejavaMailSender
in async. The mails sometimes get sent after thejavaMailSender
already mock got reset. When the mock is configured again in the@BeforeEach
methodmockMailService()
there already exists a recorded call on the mock which causes the crypticUnfinishedStubbingException
.This happened in the
@BeforeEach
oftestGetPostsForCourse_WithExerciseIdRequestParam()
which is always run directly aftertestCreateAnnouncement()
.The PR adds a
verify
statement at the end oftestCreateAnnouncement()
, making sure that the mails are sent before starting the next test.Review Progress
Look at the code changes and feel free to run
PostIntegrationTest
multiple times using the following script (inspired by the script from #6506).Code Review
Test Coverage
unchanged