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

Bulk Assigner Test Implementations #2262

Merged
merged 4 commits into from
Nov 10, 2023
Merged

Conversation

BradleyOlson64
Copy link
Contributor

Implemented bulk assigner tests covering all invariants thought of thus far.

@BradleyOlson64 BradleyOlson64 added the T8-polkadot This PR/Issue is related to/affects the Polkadot network. label Nov 10, 2023
@BradleyOlson64 BradleyOlson64 self-assigned this Nov 10, 2023
Copy link
Member

@eskimor eskimor left a 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 {
Copy link
Member

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)
Copy link
Member

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 :-)

@eskimor eskimor merged commit 23fcfc8 into rk-core-time-prep Nov 10, 2023
7 of 11 checks passed
@eskimor eskimor deleted the brad-bulk-assigner-tests branch November 10, 2023 10:02
eskimor pushed a commit that referenced this pull request Nov 14, 2023
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`
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Mar 26, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Mar 27, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
…itytech#2264)

* GRANDPA: optimize votes_ancestries when needed

* Address review comments
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* GRANDPA: optimize votes_ancestries when needed

* Address review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T8-polkadot This PR/Issue is related to/affects the Polkadot network.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants