-
Notifications
You must be signed in to change notification settings - Fork 683
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
Bulk Assigner Test Implementations #2262
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @BradleyOlson64 !
..CoreState::default() | ||
let expected_descriptor_1: CoreDescriptor<BlockNumberFor<Test>> = | ||
CoreDescriptor { queue: None, current_work: None }; | ||
let expected_descriptor_2 = CoreDescriptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More descriptive naming would make this more readable. E.g. empty_descriptor, single_entry_descriptor.
@@ -461,12 +534,21 @@ fn assignment_proportions_in_core_state_work() { | |||
Some(BulkAssignment::Bulk(task_1.into())) | |||
); | |||
// Pos should have incremented, as assignment had remaining < step | |||
assert_eq!(Workload::<Test>::get(core_idx).pos, 1u16); | |||
assert_eq!( | |||
CoreDescriptors::<Test>::get(core_idx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more pop would be nice, to see that it advances to task 2. You are checking pos already, but still would be nice :-)
Addressed comments from #2262 Also added tests to cover the new cases: - Test that assignments are served correctly. E.g. two equal assignments will be served as ABABAB - Have a test that checks that core is shared fairly, even in case of `ratio` not being divisible by `step`
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
…itytech#2264) * GRANDPA: optimize votes_ancestries when needed * Address review comments
Implemented bulk assigner tests covering all invariants thought of thus far.