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

Fix mock tests - futures unordered bug #1642

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

e-ivkov
Copy link
Contributor

@e-ivkov e-ivkov commented Nov 26, 2021

Signed-off-by: Egor Ivkov e.o.ivkov@gmail.com

Description of the Change

  1. Fixes a bug accidentally introduced by FuturesUnordered pr
  2. Fixes usual failures of unregister_peer test, which did not wait for needed amount of time

Bug Description

In test_network and sumeragi_with_mock tests in several places there were dependencies on particular order of the responses that Network::send (now Network::send_to_actors_on_peers) would return. With introduction of FuturesUnordered the order is now random there, so tests started failing from time to time.

The general problem was that code that used the function assumed a specific behavior of the function which was neither documented nor contained in a type.

Issue

#1637

Benefits

We can rely on mock tests again.

Possible Drawbacks

Usage Examples or Tests [optional]

Alternate Designs [optional]

@github-actions github-actions bot added the iroha2-dev The re-implementation of a BFT hyperledger in RUST label Nov 26, 2021
appetrosyan
appetrosyan previously approved these changes Nov 26, 2021
Signed-off-by: Egor Ivkov <e.o.ivkov@gmail.com>
mversic
mversic previously approved these changes Nov 26, 2021
@codecov
Copy link

codecov bot commented Nov 26, 2021

Codecov Report

Merging #1642 (0b1f534) into iroha2-dev (0daef60) will increase coverage by 1.86%.
The diff coverage is 38.70%.

Impacted file tree graph

@@              Coverage Diff               @@
##           iroha2-dev    #1642      +/-   ##
==============================================
+ Coverage       75.00%   76.86%   +1.86%     
==============================================
  Files             120      120              
  Lines           19942    19955      +13     
==============================================
+ Hits            14957    15338     +381     
+ Misses           4985     4617     -368     
Impacted Files Coverage Δ
core/test_network/tests/sumeragi_with_mock.rs 0.24% <0.00%> (-0.01%) ⬇️
core/src/sumeragi/mod.rs 87.46% <50.00%> (+9.37%) ⬆️
core/test_network/src/lib.rs 80.41% <50.00%> (+3.68%) ⬆️
data_model/src/lib.rs 65.45% <75.00%> (+0.23%) ⬆️
client/tests/tests/asset_propagation.rs 100.00% <100.00%> (ø)
client/tests/tests/multisignature_transaction.rs 100.00% <100.00%> (ø)
client/tests/tests/unregister_peer.rs 100.00% <100.00%> (+100.00%) ⬆️
core/src/samples.rs 100.00% <100.00%> (ø)
client/tests/tests/events.rs 57.47% <0.00%> (-41.38%) ⬇️
p2p/src/peer.rs 76.61% <0.00%> (-0.67%) ⬇️
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0daef60...0b1f534. Read the comment docs.

@e-ivkov e-ivkov merged commit b216aed into hyperledger:iroha2-dev Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants