Skip to content

Commit

Permalink
test.sh: Set RUST_LIB_BACKTRACE=0 so debug_assertions tests don…
Browse files Browse the repository at this point in the history
…'t take forever due to capturing a ton of backtraces (#967)

We still want `RUST_BACKTRACE=1` to print a backtrace on panicking, as
that's very useful and doesn't slow tests down. But that also causes
`Backtrace::capture()` to actually capture a backtrace, and since we do
that in every `DisjointMut::{index,index_mut}` call, it makes the tests
extremely slow. Setting `RUST_LIB_BACKTRACE=0` overrides this and makes
the tests fast (enough) again. And it can always be overridden again on
the command line.
  • Loading branch information
kkysen authored Apr 12, 2024
2 parents 10404a7 + 0fbab07 commit 8ddc133
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,17 @@ test_args=(
--suite testdata-multi
)

# We want `RUST_BACKTRACE=1` in order to print a backtrace on panicking,
# as that's very useful and doesn't slow tests down.
# But that also causes `Backtrace::capture()`` to actually capture a backtrace,
# and since we do that in every `DisjointMut::{index,index_mut}` call,
# it makes the tests extremely slow.
# Setting `RUST_LIB_BACKTRACE=0` overrides this and makes the tests fast (enough) again.
# And it can always be overridden again on the command line.
#
# See more in the docs for `Backtrace::capture`.
export RUST_BACKTRACE=1
export RUST_LIB_BACKTRACE=${RUST_LIB_BACKTRACE:-0}

if [[ -z $seek_stress_test_rust_path ]]; then
: # stress test binary not provided; don't include seek stress tests
Expand Down

0 comments on commit 8ddc133

Please sign in to comment.