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] #4397: Make queue tests use a mock time source #4400

Merged
merged 3 commits into from Apr 1, 2024

Conversation

DCNick3
Copy link
Contributor

@DCNick3 DCNick3 commented Apr 1, 2024

Description

This PR adds a TimeSource to iroha_primitives - a mockable time source. It then proceeds to make the queue tests use the mock time source to make them deterministic.

Linked issue

Closes #4397

Benefits

  • less flaky CI
  • ability to mock transaction times (useful here)

Checklist

  • make CI pass

@github-actions github-actions bot added Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST labels Apr 1, 2024
@DCNick3
Copy link
Contributor Author

DCNick3 commented Apr 1, 2024

We still use SystemTime in BlockBuilder<Pending>::make_header(), but it doesn't seem to be a source of flakiness for now.

@Erigara Erigara self-assigned this Apr 1, 2024
@coveralls
Copy link
Collaborator

coveralls commented Apr 1, 2024

Pull Request Test Coverage Report for Build 8506806320

Details

  • 211 of 228 (92.54%) changed or added relevant lines in 3 files are covered.
  • 5314 unchanged lines in 95 files lost coverage.
  • Overall coverage increased (+0.9%) to 57.684%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/src/queue.rs 159 160 99.38%
primitives/src/time.rs 26 42 61.9%
Files with Coverage Reduction New Missed Lines %
primitives/src/conststr.rs 1 91.14%
crypto/src/hash.rs 1 73.78%
ffi/derive/src/convert.rs 1 84.45%
primitives/src/lib.rs 1 0.0%
core/src/sumeragi/network_topology.rs 1 98.78%
primitives/src/must_use.rs 2 74.29%
crypto/src/signature/bls/mod.rs 2 0.0%
config/src/snapshot.rs 3 78.57%
data_model/derive/src/has_origin.rs 3 95.16%
config/src/kura.rs 3 80.0%
Totals Coverage Status
Change from base Build 7884695009: 0.9%
Covered Lines: 23489
Relevant Lines: 40720

💛 - Coveralls

primitives/src/time.rs Outdated Show resolved Hide resolved
core/src/queue.rs Show resolved Hide resolved
This allows to pass mock time sources to parts of iroha

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
…source

Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <dcnick3@users.noreply.github.com>
@DCNick3 DCNick3 merged commit 6387b54 into hyperledger:iroha2-dev Apr 1, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working iroha2-dev The re-implementation of a BFT hyperledger in RUST
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants