Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

chore: test helper arbitrary ordering for 2 #3762

Merged
merged 2 commits into from
Sep 1, 2021

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Sep 1, 2021

Adds a test helper to allow incoming messages that might come in non-deterministic order.

Current impl is limited to two patterns.

Anticipated usage

let (header, zer0bytes) = arbitrary_order!(
     overseer_recv(&mut virtual_overseer).await;
     AllMessages::ChainApi(ChainApiMessage::BlockHeader(
				relay_parent,
				tx,
			)) => {
				assert_eq!(relay_parent, new_leaf);
				tx.send(Ok(Some(header))).unwrap();
				header
			};
AllMessages::ChainApi(ChainApiMessage::Ancestors{..
			}) => {
                               ///...
                               vec![0u32;16]
			}
);

@drahnr drahnr added A0-please_review Pull request needs code review. A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Sep 1, 2021
@drahnr drahnr force-pushed the bernhard-test-helper-arbitrary-ordering-for-2 branch from 8477d14 to 4a5b88f Compare September 1, 2021 11:08
@drahnr drahnr self-assigned this Sep 1, 2021
@eskimor
Copy link
Member

eskimor commented Sep 1, 2021

Nice! Thanks Bernhard!

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.

Nit: Shouldn't this be in subsystem-test-helpers?

@drahnr
Copy link
Contributor Author

drahnr commented Sep 1, 2021

You are absolutely correct.

@eskimor eskimor merged commit ae6ee12 into master Sep 1, 2021
@eskimor eskimor deleted the bernhard-test-helper-arbitrary-ordering-for-2 branch September 1, 2021 16:53
ordian added a commit that referenced this pull request Sep 2, 2021
* master:
  dependabot: ignore yet another git dep (#3759)
  Bump serde_json from 1.0.66 to 1.0.67 (#3767)
  Bump syn from 1.0.74 to 1.0.75 (#3710)
  Companion for substrate #9371 (#3487)
  Fixes/improvements for disputes (#3753)
  chore: test helper arbitrary ordering for 2 (#3762)
  disputes: fix relay chain selection sanity check (#3750)
  technical committee is using the weight of council, but should have its own generated weight instead (#3511)
  new proxy for auctions, crowdloans, registrar, slots (#3683)
  Bump libc from 0.2.100 to 0.2.101 (#3726)
  Removed unneeded deps (#3658)
  Bump serde from 1.0.127 to 1.0.130 (#3739)
  Companion for Generate storage info for pallet authority_discovery #9428 (#3517)
  Return a Result in invert_location (#3730)
  XCM: Allow reclaim of assets dropped from holding (#3727)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. A2-insubstantial Pull request requires no code review (e.g., a sub-repository hash update). B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants