Skip to content

chore: improve miner simulator flakiness#753

Merged
jansegre merged 1 commit intomasterfrom
chore/miner-simulator-flakiness
Aug 24, 2023
Merged

chore: improve miner simulator flakiness#753
jansegre merged 1 commit intomasterfrom
chore/miner-simulator-flakiness

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Aug 23, 2023

Motivation

Due to the expected behavior of the StopAfterNMinedBlocks trigger, which is to stop the simulation after finding "at least N blocks", some tests were flaky. A new mechanism is introduced directly on the miner simulator to guarantee it stops producing blocks after exactly N blocks are found.

This new mechanism is used specifically in Feature Activation mining simulation tests, but any other tests that are found to be flaky because of this behavior, could be migrated to this alternative.

Acceptance Criteria

  • Implement new pause_after_exactly() method for miner simulators
  • Update Feature Activation mining simulation tests to use this new method

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco added enhancement New feature or request tests labels Aug 23, 2023
@glevco glevco self-assigned this Aug 23, 2023
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #753 (6ee97e8) into master (4277cc2) will increase coverage by 0.04%.
Report is 6 commits behind head on master.
The diff coverage is 84.44%.

❗ Current head 6ee97e8 differs from pull request most recent head bd5311f. Consider uploading reports for the commit bd5311f to get more accurate results

@@            Coverage Diff             @@
##           master     #753      +/-   ##
==========================================
+ Coverage   84.62%   84.67%   +0.04%     
==========================================
  Files         253      252       -1     
  Lines       21708    21770      +62     
  Branches     2941     2946       +5     
==========================================
+ Hits        18371    18434      +63     
+ Misses       2702     2692      -10     
- Partials      635      644       +9     
Files Changed Coverage Δ
hathor/simulator/trigger.py 100.00% <ø> (ø)
hathor/p2p/utils.py 73.87% <66.66%> (-1.40%) ⬇️
hathor/builder/builder.py 91.51% <80.00%> (-1.49%) ⬇️
hathor/builder/cli_builder.py 74.48% <100.00%> (+0.53%) ⬆️
hathor/manager.py 82.76% <100.00%> (+0.07%) ⬆️
hathor/mining/block_template.py 94.33% <100.00%> (+5.87%) ⬆️
hathor/p2p/resources/status.py 100.00% <100.00%> (ø)
hathor/p2p/states/ready.py 93.89% <100.00%> (-0.05%) ⬇️
hathor/simulator/miner/geometric_miner.py 100.00% <100.00%> (ø)
hathor/transaction/base_transaction.py 93.99% <100.00%> (+<0.01%) ⬆️

... and 4 files with indirect coverage changes

jansegre
jansegre previously approved these changes Aug 23, 2023
@glevco glevco force-pushed the feat/feature-activation/bit-signal-templates branch from c3361c8 to f89cd71 Compare August 23, 2023 17:48
@glevco glevco force-pushed the chore/miner-simulator-flakiness branch from 6ee97e8 to 4b68c2c Compare August 23, 2023 17:48
msbrogli
msbrogli previously approved these changes Aug 23, 2023
Base automatically changed from feat/feature-activation/bit-signal-templates to master August 23, 2023 20:40
@jansegre jansegre dismissed stale reviews from msbrogli and themself August 23, 2023 20:40

The base branch was changed.

@glevco glevco force-pushed the chore/miner-simulator-flakiness branch from 4b68c2c to bd5311f Compare August 23, 2023 20:44
@glevco glevco marked this pull request as ready for review August 23, 2023 20:44
@jansegre jansegre merged commit 4c664ff into master Aug 24, 2023
@jansegre jansegre deleted the chore/miner-simulator-flakiness branch August 24, 2023 16:50
@glevco glevco mentioned this pull request Aug 24, 2023
1 task
This was referenced Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request tests

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants