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

The test_sync integration test doesn't call on_block_imported #6033

Closed
tomaka opened this issue May 14, 2020 · 2 comments · Fixed by #6039
Closed

The test_sync integration test doesn't call on_block_imported #6033

tomaka opened this issue May 14, 2020 · 2 comments · Fixed by #6039
Labels
I3-bug The node fails to follow expected behavior.

Comments

@tomaka
Copy link
Contributor

tomaka commented May 14, 2020

The documentation of NetworkWorker::on_block_imported mentions that it is mandatory to call it after importing a block. However our test_sync integration test doesn't do that.

This test is extremely intricate and consists in a bunch of components glued together like spaghettis cooked for too long and without oil. I have no idea how to fix that problem, and I'd recommend rewriting the test from scratch.

At the time of opening this issue, I'm about to introduce a performance-degrading hack in the network crate to bypass this problem. Please search for this issue number in the source code after fixing it.
EDIT: #5938

@tomaka tomaka added the I3-bug The node fails to follow expected behavior. label May 14, 2020
@arkpar
Copy link
Member

arkpar commented May 14, 2020

It is supposed to be called here:

peer.network.on_block_imported(

@tomaka
Copy link
Contributor Author

tomaka commented May 14, 2020

I've tried running the test and print a message in on_block_imported to check whether it is called, and can confirm that it isn't.

The code used in the integration test is this one:
https://github.com/paritytech/substrate/blob/master/client/service/test/src/lib.rs

It's very redundant with the one on sc_network/test

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug The node fails to follow expected behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants