Repository navigation
Conversation
`test_amount_add_overflow` and `test_amount_sub_overflow` expect the "attempt to ... with overflow" panic, which only exists where overflow checks are enabled. Release builds turn them off, so the arithmetic wraps and both tests fail under `cargo test --release`. That breaks the Nix flake's `rust` package, which runs its check phase in the release profile, and with it `packages.default`. Mark them ignored when `debug_assertions` is off, so a release run reports them as skipped, with the reason, instead of failing. Changelog-None Signed-off-by: cdecker <cdecker@blockstream.com>
Member
Author
|
Duplicate of #9423, which fixes the same release-profile test failure by making the Amount arithmetic checked instead; closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_amount_add_overflowandtest_amount_sub_overfloware#[should_panic(expected = "attempt to ... with overflow")], but that panic only exists where overflow checks are on. Release builds turn them off, the arithmetic wraps, and both tests fail:That in turn breaks the Nix flake's
rustpackage on every system: crane runs its check phase in the release profile, sonix build .#rust, and with itpackages.default, fails.This marks both tests
ignored whendebug_assertionsis off. A release run then reports them as skipped, with the reason, rather than failing, and debug runs are unchanged:Test-only change; no binary is affected.