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

Attempt to address some of the consistently flaky integration tests #3440

Merged
merged 6 commits into from
Jul 26, 2024

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented Jul 24, 2024

What was wrong?

Some of our integration tests dealing with the way geth --dev mines within an interval window flaky and still not passing with a flaky decorator in some cases. I'm going to try to run this branch many times and try to address them here.

How was it fixed?

  • Add flaky geth dev mining decorator to receipt unmined tests (cadf7f8)
  • Mark certain very flaky tests with xfail + strict=False (899a909)
  • Some tests were incorrectly checking that the gasPrice on dynamic fee transactions was equal to the maxFeePerGas. Really, it's the minimum between the maxFeePerGas and maxPriorityFeePerGas + baseFeePerGas (block), which is the "effective gas price". Use <= in that comparison.

Feature:

  • Introduce a RequestTimedOut exception for when requests to the node time out.

  • Use this exception in xfail tests that fail specifically with a client-side timeout to distinguish the fail case. It isn't possible to use xfail and flaky on the same test out-of-the-box and have them work well enough. This PR adds a decorator that:

    • Accepts flaky arguments max_runs and min_passes and retries the test according to flaky rules.
    • Accepts an exception that if by the last flaky retry, if this particular exception is raised, it xfails the test with a given reason string argument, as is also accepted by xfail.

What this means is that we can retry a test up to max_runs times, but if by the end of it we have some flaky exception case that is sometimes expected, we xfail the test and it silently fails for that test run.

Todo:

Cute Animal Picture

20240719_153530

@fselmo fselmo force-pushed the further-flaky-test-adjustments branch from 99a169b to cadf7f8 Compare July 24, 2024 18:50
@fselmo fselmo force-pushed the further-flaky-test-adjustments branch 4 times, most recently from 748a686 to 687d91c Compare July 25, 2024 19:42
@fselmo fselmo changed the title [wip] Attempt to address some of the consistently flaky integration tests Attempt to address some of the consistently flaky integration tests Jul 25, 2024
@fselmo fselmo force-pushed the further-flaky-test-adjustments branch from 687d91c to 28e3715 Compare July 25, 2024 19:50
- Introduce ``RequestTimedOut`` and raise this for requests with
  timeout messaging.
- This allows us to be more specific on flaky tests that fail with
  node timeout errors. Specify ``RequestTimedOut`` as the expected
  exception in relevant tests marked with ``@pytest.mark.xfail``.
@fselmo fselmo force-pushed the further-flaky-test-adjustments branch from 28e3715 to 8965da1 Compare July 25, 2024 20:30
@fselmo fselmo marked this pull request as ready for review July 25, 2024 20:32
@fselmo fselmo force-pushed the further-flaky-test-adjustments branch from d631301 to 71af107 Compare July 25, 2024 22:29
@fselmo fselmo requested review from kclowes, pacrob and reedsa July 25, 2024 22:36
@fselmo fselmo force-pushed the further-flaky-test-adjustments branch from 71af107 to 6d80681 Compare July 25, 2024 23:35
@fselmo fselmo force-pushed the further-flaky-test-adjustments branch from a3ce6dc to 5c581e4 Compare July 26, 2024 16:51
@fselmo
Copy link
Collaborator Author

fselmo commented Jul 26, 2024

Ok @kclowes, @pacrob, @reedsa this should be ready for review. Let me know if you have any questions. This commit fixes a wrong check in some tests that the gasPrice should always equal the maxFeePerGas. In reality, the effective gas price is the minimum between maxFeePerGas and maxPriorityFeePerGas + block's baseFeePerGas.

Copy link
Contributor

@pacrob pacrob left a comment

Choose a reason for hiding this comment

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

🐑

Copy link
Contributor

@reedsa reedsa left a comment

Choose a reason for hiding this comment

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

lgtm

@fselmo fselmo merged commit 5fe5dc4 into ethereum:main Jul 26, 2024
71 checks passed
@fselmo fselmo deleted the further-flaky-test-adjustments branch July 26, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants