-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Publish metrics test is flaky #7267
Comments
Looking at the logs, and it seems the reason the test failed is because the assumption that Alice produced 2 blocks is not met:
The reason that is not happening is because a
The code for wait_for_blocks is something like this, so it will count twice block one and it will exit, hence why the fail assert later down the line.
Possible solutions:
|
When an re-org happens wait_for_blocks(2) would actually exit after the second import of blocks 1, so the conditions for the metric to exist won't be met hence the occasional test failure. More details in: paritytech#7267 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Proposed fix here: #7279 |
Good idea. |
Any thoughts if the current behaviour of the the function is correct in the presence of a Reorg, just by looking at the documentation of the API, I would say it does what we expect it to do:
|
I think I have written this and the idea was waiting for the chain to build |
* metrics: tests: Fix flaky runtime_can_publish_metrics When an re-org happens wait_for_blocks(2) would actually exit after the second import of blocks 1, so the conditions for the metric to exist won't be met hence the occasional test failure. More details in: #7267 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io> * metrics: tests: Cleanup un-needed box pin Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io> --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
fixed in #7279 |
In the cases where a reorg happens we might receive notifications for different blocks at the same level, so instead of the chain having count new blocks it has less and that will break the tests which use this function. So, use the block number to identify that `count` blocks have been built in the chain. Examples where this issue was hit: paritytech/polkadot#7267 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
I guess you mean something like this: paritytech/substrate#14215 ? |
In the cases where a reorg happens we might receive notifications for different blocks at the same level, so instead of the chain having count new blocks it has less and that will break the tests which use this function. So, use the block number to identify that `count` blocks have been built in the chain. Examples where this issue was hit: paritytech/polkadot#7267 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
In the cases where a reorg happens we might receive notifications for different blocks at the same level, so instead of the chain having count new blocks it has less and that will break the tests which use this function. So, use the block number to identify that `count` blocks have been built in the chain. Examples where this issue was hit: paritytech/polkadot#7267 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
In the cases where a reorg happens we might receive notifications for different blocks at the same level, so instead of the chain having count new blocks it has less and that will break the tests which use this function. So, use the block number to identify that `count` blocks have been built in the chain. Examples where this issue was hit: paritytech/polkadot#7267 Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Working on some HostConfiguration changes, I had the runtime_can_publish_metrics test failing https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/2871112.
The text was updated successfully, but these errors were encountered: