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

Binary Agreement test updated to the proptest framework #336

Merged
merged 5 commits into from
Nov 20, 2018

Conversation

vkomenda
Copy link
Contributor

In the process of updating the BA test I had to remove the observer check temporarily from that test until we implement observers in the test framework. See #322.

I also removed logging from the test in advance of EventLog, see #335.

@vkomenda vkomenda requested review from mbr and afck November 13, 2018 10:06
Copy link
Collaborator

@afck afck left a comment

Choose a reason for hiding this comment

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

Looks good to me, apart from minor questions.
I'll leave it to @mbr to check the intended usage of VirtualNet and approve.

tests/binary_agreement.rs Outdated Show resolved Hide resolved

mod network;
pub mod net;
Copy link
Collaborator

Choose a reason for hiding this comment

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

That shouldn't be pub.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are lots of "method is never used" lints otherwise in the net module.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right; some of them are already marked as #[allow(unused)]—maybe we should apply that attribute to the whole net module instead (either inside it, or at the use statements)? That would make the reason clearer than the pub.

Copy link
Contributor

Choose a reason for hiding this comment

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

One option would also be to make the testing framework a proper crate and just import that; I've done this on another project.

It's a bit more work, but it also does not require importing a million different crates on each test cases - right now, whenever I add a dependency to the net testing framework, I also need to add one in every test case.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right, I guess that would be the proper solution. 👍
(Something for another PR, though.)

tests/binary_agreement.rs Show resolved Hide resolved
tests/binary_agreement.rs Outdated Show resolved Hide resolved
@vkomenda
Copy link
Contributor Author

@mbr, please check the usage of VirtualNet.

Copy link
Contributor

@mbr mbr left a comment

Choose a reason for hiding this comment

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

There are some things I would probably think about a bit further, however, we will have to re-examine this anyway once we get the nomenclature changes, fault log (#338) checking, the contested on-VirtualNet-observers and other things in.

The current version seems to run and is not a dependency of anything, so I am fine with moving along, merging this and then revisiting it later.

/// Strategy to generate a test configuration.
fn arb_config()
(
dimension in NetworkDimension::range(1, 50),
Copy link
Contributor

Choose a reason for hiding this comment

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

Just nothing that we need to be doubly sure 1 is a workable network size for the test (it's not for net_dynamic_hb, for example, since a node gets removed). Should you need to change it, beware that the 1-50 range here refers to the random initial size, not the minimum.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd say we definitely want BA to work with a size of 1.

Copy link
Contributor Author

@vkomenda vkomenda Nov 19, 2018

Choose a reason for hiding this comment

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

If proptest reduces it to 1 in case of failure anyway, maybe it's worth starting from above 1.

tests/binary_agreement.rs Show resolved Hide resolved
@vkomenda vkomenda merged commit 5735cf2 into master Nov 20, 2018
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