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

sequencer: fix flaky unit tests #818

Closed
noot opened this issue Mar 14, 2024 · 1 comment
Closed

sequencer: fix flaky unit tests #818

noot opened this issue Mar 14, 2024 · 1 comment
Labels
bug Something isn't working sequencer pertaining to the astria-sequencer crate

Comments

@noot
Copy link
Collaborator

noot commented Mar 14, 2024

the tests are flaky due to using a global for the native asset:

failures:

error: test failed, to rerun pass `-p astria-sequencer --lib`
---- app::test::app_deliver_tx_bridge_lock_action_invalid_for_eoa stdout ----
thread 'app::test::app_deliver_tx_bridge_lock_action_invalid_for_eoa' panicked at crates/astria-sequencer/src/asset/mod.rs:18:10:
native asset should only be set once: Denom { id: Id([112, 64, 49, 200, 104, 253, 61, 60, 132, 161, 207, 168, 203, 69, 222, 186, 78, 167, 70, 180, 70, 151, 247, 244, 166, 237, 27, 143, 108, 35, 155, 130]), base_denom: "nria", prefix: "" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    app::test::app_deliver_tx_bridge_lock_action_invalid_for_eoa

potential solutions from @SuperFluffy :

  • Remember the const-sha2 impl that I made in March 2023? (And was ultimately of no use to us)? We could bake that into our services, since that's what your denom id is basically make it work on stable saleemrashid/sha2-const#5
  • You move the global initializer outside the squencer library-initializer and into main. So basically you make a freestanding function that you call from main. The accessors in the library-part of Sequencer never initialize, only access. This way you can protect the global similar to how we do telemetry bringup
  • Another option is function memoization which is a more batteries-included (but similar approach) to oncecell/lazy etc
@noot noot added bug Something isn't working sequencer pertaining to the astria-sequencer crate labels Mar 14, 2024
@noot
Copy link
Collaborator Author

noot commented Jun 5, 2024

closing for now as i have not seen any flakiness in a while

@noot noot closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

No branches or pull requests

1 participant