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

fix: Removing flakiness from staking tests #3150

Merged
merged 4 commits into from
Aug 12, 2020

Conversation

SkidanovAlex
Copy link
Collaborator

The flakiness was primarily due to insufficient number of blocks between the epoch switch, and checking for the expected stakes. The epoch was switching at heights equal to 2 modulo 10, and the checks were executed at the same heights. Moreover, the height was retrieved from one node, but the checks were against the other.
Fixing it by extending the epoch by two blocks, and moving the checks two blocks ahead.

Also adding checks before sending the second set of stakes, it covers a situation when the latest stake during the current epoch is higher than the current stake (a situation the test was not previously testing).

Reducing the timeout to 6 minutes from 10 minutes. staking2.py, staking_repro1.py and staking_repro2.py mostly test the same things, so it is still 18 minutes of testing per run. All the failures in the observable past were occurring much earlier than during the first 6 minutes of the test (e.g. see failures here: http://nayduck.eastus.cloudapp.azure.com:3000/#/run/67).

Fixes #3128

Test plan:

No failures in 150 runs:
http://nayduck.eastus.cloudapp.azure.com:3000/#/run/69

The flakiness was primarily due to insufficient number of blocks between the epoch switch, and checking for the expected stakes. The epoch was switching at heights equal to 2 modulo 10, and the checks were executed at the same heights. Moreover, the height was retrieved from one node, but the checks were against the other.
Fixing it by extending the epoch by two blocks, and moving the checks two blocks ahead.

Also adding checks before sending the second set of stakes, it covers a situation when the latest stake during the current epoch is higher than the current stake (a situation the test was not previously testing).

Reducing the timeout to 6 minutes from 10 minutes. staking2.py, staking_repro1.py and staking_repro2.py mostly test the same things, so it is still 18 minutes of testing per run. All the failures in the observable past were occurring much earlier than during the first 6 minutes of the test (e.g. see failures here: http://nayduck.eastus.cloudapp.azure.com:3000/#/run/67).

Test plan:
----------
No failures in 150 runs:
http://nayduck.eastus.cloudapp.azure.com:3000/#/run/69
@gitpod-io
Copy link

gitpod-io bot commented Aug 12, 2020

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #3150 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3150   +/-   ##
=======================================
  Coverage   87.35%   87.35%           
=======================================
  Files         212      212           
  Lines       41525    41525           
=======================================
  Hits        36274    36274           
  Misses       5251     5251           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f4c4489...342da33. Read the comment docs.

@nearprotocol-bulldozer nearprotocol-bulldozer bot merged commit bd18e1c into master Aug 12, 2020
@nearprotocol-bulldozer nearprotocol-bulldozer bot deleted the fix_staking_flakines branch August 12, 2020 23:29
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.

staking tests are flaky
2 participants