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

Remove transaction-pool test-helpers feature #10571

Merged
merged 4 commits into from
Jan 3, 2022

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Dec 30, 2021

test-helpers feature is a bad idea in general, because once the feature is enabled somewhere in
the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to
get rid off other "only test" related code.

Contributes towards: #9727

`test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in
the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to
get rid off other "only test" related code.

Contributes towards: #9727
@bkchr bkchr added A0-please_review Pull request needs code review. 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 Dec 30, 2021
client/transaction-pool/tests/pool.rs Outdated Show resolved Hide resolved
client/transaction-pool/tests/pool.rs Outdated Show resolved Hide resolved
pub fn new_test(
pool_api: Arc<PoolApi>,
) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>, intervalier::BackSignalControl) {
pub fn new_test(pool_api: Arc<PoolApi>) -> (Self, Pin<Box<dyn Future<Output = ()> + Send>>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used outside this create? Can't we gate it on cfg(test)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes it is used outside. The naming is also obvious enough that you don't call this in production code, imo.


// This will prune `xt1`.
block_on(pool.maintain(block_event(header)));

assert_eq!(pool.status().ready, 0);
}

#[test]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this one removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the test is useless, it doesn't test anything.

maintain is only called for best blocks nowadays (wasn't back in the old days)

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
@bkchr
Copy link
Member Author

bkchr commented Jan 3, 2022

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot
Copy link

Merge cancelled due to error. Error: Checks failed for 01c35c0

@bkchr
Copy link
Member Author

bkchr commented Jan 3, 2022

bot merge

@paritytech-processbot
Copy link

Bot will approve on the behalf of @bkchr, since they are a team lead, in an attempt to reach the minimum approval count

@paritytech-processbot paritytech-processbot bot merged commit a798e29 into master Jan 3, 2022
@paritytech-processbot paritytech-processbot bot deleted the bkchr-transaction-pool-test-helpers branch January 3, 2022 15:08
grishasobol pushed a commit to gear-tech/substrate that referenced this pull request Mar 28, 2022
* Remove transaction-pool `test-helpers` feature

`test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in
the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to
get rid off other "only test" related code.

Contributes towards: paritytech#9727

* Apply suggestions from code review

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Fix benches

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
ark0f pushed a commit to gear-tech/substrate that referenced this pull request Feb 27, 2023
* Remove transaction-pool `test-helpers` feature

`test-helpers` feature is a bad idea in general, because once the feature is enabled somewhere in
the workspace, it is enabled anywhere. While removing the feature, the tests were also rewritten to
get rid off other "only test" related code.

Contributes towards: paritytech#9727

* Apply suggestions from code review

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Fix benches

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
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. 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