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

[Do not merge] Check that CI test failures show backtraces #1604

Closed
wants to merge 8 commits into from

Conversation

daira
Copy link
Contributor

@daira daira commented Nov 2, 2024

This is pacu/feature/transparent-balance from #1570, at a commit known to have a test failure, with #1603 cherry-picked onto it.

pacu and others added 6 commits October 28, 2024 10:23
…unds

closes zcash#1411

- Adds min_confirmations to transparent account balances
- Adds a new `transparent_balance_spendability` test to verify
transparent funds spendability.
- cargo clippy + cargo fmt

Refactor: Extract Method on lambda `check_balance`
@daira daira added the testing label Nov 2, 2024
daira added 2 commits November 2, 2024 17:59
* `cargo test --all-targets --all-features`:
  * 484s (354s build, 130s tests)
* `cargo test --release --all-targets --all-features`:
  * 541s (415s build, 126s tests)
* `cargo test --profile=dev --all-targets --all-features`:
  * 1709s (146s build, 1563s tests)
  * this might still be faster when running individual tests
Signed-off-by: Daira-Emma Hopwood <[email protected]>
@daira
Copy link
Contributor Author

daira commented Nov 2, 2024

Here are the backtraces for the expected failure.

From CI:

---- wallet::transparent::tests::transparent_balance_spendability stdout ----
thread 'wallet::transparent::tests::transparent_balance_spendability' panicked at /home/runner/work/librustzcash/librustzcash/zcash_client_backend/src/data_api/testing/transparent.rs:56:5:
assertion `left == right` failed
  left: Some(Zatoshis(100000))
 right: Some(Zatoshis(0))
stack backtrace:
   0: rust_begin_unwind
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:647:5
   1: core::panicking::panic_fmt
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/panicking.rs:72:14
   2: core::panicking::assert_failed_inner
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/panicking.rs:342:17
   3: core::panicking::assert_failed
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/panicking.rs:297:5
   4: zcash_client_backend::data_api::testing::transparent::check_balance
   5: zcash_client_backend::data_api::testing::transparent::transparent_balance_spendability
             at /home/runner/work/librustzcash/librustzcash/zcash_client_backend/src/data_api/testing/transparent.rs:361:5
   6: zcash_client_sqlite::wallet::transparent::tests::transparent_balance_spendability
             at ./src/wallet/transparent.rs:897:9
   7: zcash_client_sqlite::wallet::transparent::tests::transparent_balance_spendability::{{closure}}
             at ./src/wallet/transparent.rs:896:42
   8: core::ops::function::FnOnce::call_once
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/ops/function.rs:250:5
   9: core::ops::function::FnOnce::call_once
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Locally with RUST_BACKTRACE=1 cargo test gives the same result as CI, modulo paths.

Locally with RUST_BACKTRACE=1 cargo test --profile=dev gives essentially the same result except that we also have a line number in check_balance:

[...]
   4: zcash_client_backend::data_api::testing::transparent::check_balance
             at /media/ssd/home/daira/research/librustzcash/zcash_client_backend/src/data_api/testing/transparent.rs:56:5
   5: zcash_client_backend::data_api::testing::transparent::transparent_balance_spendability
             at /media/ssd/home/daira/research/librustzcash/zcash_client_backend/src/data_api/testing/transparent.rs:361:5
[...]

Obtaining nearly the same stack trace as with full debug info, and with an overall improvement in build+test time, seems like a good deal to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants