Simple simulation of what I encountered on that day with huj agha ye shateri
The code on the master branch contains the faulty implementation.
cargo testshould have an output like this:
thread 'test::model_check' panicked at src/lib.rs:48:17:
assertion `left != right` failed
left: 0
right: 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
test::model_check
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s
error: test failed, to rerun pass `--lib`
First, enable loom tracker on the project and save states in a file
LOOM_CHECKPOINT_INTERVAL=1 LOOM_CHECKPOINT_FILE=$PWD/out.json cargo testNow enable loom tracing on the failing scenario(s)
LOOM_LOG=debug \
LOOM_LOCATION=1 \
LOOM_CHECKPOINT_INTERVAL=1 \
LOOM_CHECKPOINT_FILE=$PWD/out.json \
RUSTFLAGS="--cfg loom" cargo testor if you need more debug info, swap debug with trace in the command above
The code on solution branch is the fixed code