Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove priority::flush and rename node::block_confirm to node::start_election #4276

Merged
merged 3 commits into from
Sep 5, 2023

Conversation

clemahieu
Copy link
Contributor

This PR contains 3 commits that:

  • Removes blocking nano::test::confirm functions which have functionality superceded by nano::test::start_elections which polls a nano::system rather than using a thread wait
  • Renames nano::block_confirm to node::start_election. This adresses a TODO item to better name this function and make it not block
  • Removes priority::flush function as flush functions are being removed from the codebase.

pwojcikdev
pwojcikdev previously approved these changes Sep 4, 2023
Copy link
Contributor

@pwojcikdev pwojcikdev left a comment

Choose a reason for hiding this comment

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

The change doesn't look bad, but I don't think the usage and implementation of nano::test::start_elections is correct, since it uses a release_assert(..) internally. That will just abort the whole testsuite run on the first error. The correct way would be to have nano::test::start_elections return a boolean and call it with ASSERT_TRUE(nano::test::start_elections(..)) similar to the way it was done so far.

nano/test_common/testutil.hpp Outdated Show resolved Hide resolved
…nano::test::start_elections which uses a nano::system to poll.

This function both started an election and returned whether the block was confirmed. This is an asynchronous operation which required thread blocking. Instead, use start_elections which has polling semantics.
This is unwinding some of the blocking operations on the node class and addresses a TODO item to improve this function name.
Fixes election.construction test where election might become active/inactive before it can be polled in the test. Removes election_scheduler.flush_vacancy which only tested the flush function.
@clemahieu clemahieu merged commit b6d5d01 into nanocurrency:develop Sep 5, 2023
14 of 17 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants