Skip to content

fix flaky CustomFakerTest#1492

Merged
kingthorin merged 1 commit intomainfrom
tests/fix-flaky-test-with-weighted-insect
Jan 28, 2025
Merged

fix flaky CustomFakerTest#1492
kingthorin merged 1 commit intomainfrom
tests/fix-flaky-test-with-weighted-insect

Conversation

@asolntsev
Copy link
Copy Markdown
Collaborator

No description provided.

@asolntsev asolntsev self-assigned this Jan 28, 2025
@asolntsev asolntsev marked this pull request as draft January 28, 2025 17:12
@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Jan 28, 2025

PR Summary

  • Include CustomFakerTest.java in the Build Process
    The pom.xml file has been updated to include CustomFakerTest.java in the program's build process. This means that when the project is being put together for deployment or testing, the code from CustomFakerTest.java is now being included, ensuring this part of the code is also compiled and tested.

  • Increase Execution Frequency of weightedInsectNameTest
    The method weightedInsectNameTest in the CustomFakerTest.java file will now be run 10,000 times during testing. This was done by replacing the @Test annotation with @RepeatedTest(10_000). As a result, this specific test will be more extensively vetted, thereby more effectively ensuring the accuracy and reliability of the software.

@asolntsev asolntsev added the enhancement New feature or request label Jan 28, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 28, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.48%. Comparing base (2299a6a) to head (b9c85cb).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1492      +/-   ##
============================================
+ Coverage     92.33%   92.48%   +0.15%     
- Complexity     3263     3269       +6     
============================================
  Files           325      325              
  Lines          6417     6417              
  Branches        625      625              
============================================
+ Hits           5925     5935      +10     
+ Misses          339      335       -4     
+ Partials        153      147       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

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

Why Do we really want 3million operations vs 100?

Selecting random 100 insects was not big enough number: sometimes the test failed.
For example, {Fire ant=17, Driver ant=62, Harvester ant=21}.

Now we select 300 insects - it seems big enough to work stably.
@asolntsev asolntsev force-pushed the tests/fix-flaky-test-with-weighted-insect branch from 7a5eee5 to b9c85cb Compare January 28, 2025 18:12
@asolntsev
Copy link
Copy Markdown
Collaborator Author

asolntsev commented Jan 28, 2025

Why Do we really want 3million operations vs 100?

:)

No-no, I added @RepeatedTest(10_000) temporarily - just to be sure that my change stably fixes the problem.
The actual fix is to change "100" to "300".

@asolntsev asolntsev requested a review from kingthorin January 28, 2025 18:12
@asolntsev asolntsev marked this pull request as ready for review January 28, 2025 18:12
@asolntsev asolntsev added this to the 2.4.3 milestone Jan 28, 2025
Copy link
Copy Markdown
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

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

Thanks

@kingthorin kingthorin merged commit 4776c87 into main Jan 28, 2025
@kingthorin kingthorin deleted the tests/fix-flaky-test-with-weighted-insect branch January 28, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants