-
Notifications
You must be signed in to change notification settings - Fork 50
fix: flacky e2e tests #1607
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
fix: flacky e2e tests #1607
Conversation
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
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.
Summary of Changes
Hello @aepfli, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request aims to resolve flakiness in end-to-end tests by tackling a race condition identified in the handling of provider state changes. The core change involves implementing explicit waits for the provider to reach a READY
state before proceeding with error or stale event emissions, thereby stabilizing test execution and ensuring proper state synchronization.
Highlights
- Race Condition Fix: Addresses a suspected race condition in end-to-end tests related to provider state transitions, which was causing flakiness.
- Explicit State Waiting: Introduces explicit waiting for the
READY
provider state before emittingERROR
orSTALE
events, ensuring that subsequent events are processed only when the provider is in the expected state. - Refactored State Waiting Logic: Extracts the
Awaitility
logic into a new private static helper method,waitForProviderState
, improving code readability and reusability within the test setup.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands on the current page.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 Review
This pull request addresses flaky end-to-end tests by introducing explicit waits to ensure provider state transitions are processed deterministically. This is a good approach to resolving the underlying race condition. The refactoring of the wait logic into a waitForProviderState
method is also a good improvement. However, I've identified a logical issue in how the FATAL
provider state is tested. It is incorrectly grouped with the ERROR
state, which with the new changes will cause the test for the FATAL
case to fail deterministically. I've provided a suggestion to separate these cases, which should fully resolve the test flakiness and correctness issues.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1607 +/- ##
============================================
+ Coverage 92.06% 93.41% +1.35%
- Complexity 488 491 +3
============================================
Files 46 46
Lines 1184 1184
Branches 105 105
============================================
+ Hits 1090 1106 +16
+ Misses 62 48 -14
+ Partials 32 30 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Might be a good idea, we don't want to miss state changes |
|
superseded by #1628 - the fix and solution is way nicer - not need for this pr anymore |
Seems like we do have a race condition, where we are not entering a certain state, i assume that this might be caused by a race condition, of too many events back to back and how they are processed.
Maybe we should change the implementation of our eventing to a queue, which gets filled and taken from, to ensure events are thrown in the order they are emitted?