Skip to content

ArshiAAkhavan/shatest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shatest (shateri-test)

Simple simulation of what I encountered on that day with huj agha ye shateri

Problem

The code on the master branch contains the faulty implementation.

Run Simulation

cargo test

should 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`

Isolating Failing Scenario

First, enable loom tracker on the project and save states in a file

LOOM_CHECKPOINT_INTERVAL=1 LOOM_CHECKPOINT_FILE=$PWD/out.json cargo test

Now 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 test

or if you need more debug info, swap debug with trace in the command above

Solution

The code on solution branch is the fixed code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages