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

Made snapshot test more robust in case of asap scheduling #1274

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

vladtr
Copy link
Contributor

@vladtr vladtr commented Jun 12, 2023

This PR addresses instability of snapshot scheduler test and specifically it's part that executes "asap" scheduling with no start block.

@vladtr vladtr linked an issue Jun 12, 2023 that may be closed by this pull request
Copy link
Member

@linh2931 linh2931 left a comment

Choose a reason for hiding this comment

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

Should this also be fixed in 4.0? If so, do 4.0 first. Then merge into main.

@vladtr
Copy link
Contributor Author

vladtr commented Jun 12, 2023

Should this also be fixed in 4.0? If so, do 4.0 first. Then merge into main.

I think you right! It seems like failures started to happen in main, but 4.0 shares the same code, so I'll put it there and merge to main

@vladtr
Copy link
Contributor Author

vladtr commented Jun 13, 2023

Should this also be fixed in 4.0? If so, do 4.0 first. Then merge into main.

I think you right! It seems like failures started to happen in main, but 4.0 shares the same code, so I'll put it there and merge to main

I got confused, sorry @linh2931. In 4.0 no changes needed, since this particular test, which was flaky, was added here:
#1220
and only for main. This was not a bug, but behavior change targeted for next release (#1152)

BOOST_CHECK(block_num==pbn || ((block_num+1)==pbn));

// first pending snapshot
auto ps_start = spacing ? (spacing + (pbn%spacing)) : pbn;
Copy link
Member

Choose a reason for hiding this comment

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

As spacing is used in modular division pbn%spacing, it is more readable

auto ps_start = (spacing != 0) ? (spacing + (pbn%spacing)) : pbn;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thank you!

@vladtr vladtr requested a review from greg7mdp June 13, 2023 18:38
@vladtr vladtr merged commit 53ac7e8 into main Jun 13, 2023
@vladtr vladtr deleted the GH-1273-improve-snapshot-tst branch June 13, 2023 19:39
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.

Test failure: test_snapshot_scheduler
3 participants