Integrate BI tests with Runt & CI - #282
Conversation
…nic error messages
|
As mentioned in Slack, this is okay but maybe we can find a way to have passing tests share a |
| // output files for Runt, we register a custom panic hook that only prints | ||
| // the error message & source code location associated with the panic | ||
| // (via the `Display` trait for the `PanicHookInfo` type). | ||
| std::panic::set_hook(Box::new(|info| eprintln!("{}", info))); |
There was a problem hiding this comment.
We should handle this in a different way. Probably instead of panicing we would like to exit more cleanly in the error case.
| if case["instances"]: | ||
| cmd += ["--instances", *case["instances"]] | ||
| cmd += case["extra_args"] | ||
| if case["timeout_secs"] is not None: |
There was a problem hiding this comment.
Why would we ever need a timeout here?
There was a problem hiding this comment.
Some of the existing monitor test-cases in MONITOR_CASES (on main) have an expected timeout of 5 seconds, e.g. nested_busy_wait.prot where there are nested repeat loops and the monitor fails to infer both
outer_iters and inner_iters:
prot nested_busy_wait<DUT: Adder>(a: u32, b: u32, outer_iters: uint, inner_iters: uint, s: u32) {
DUT.a := a;
DUT.b := b;
repeat outer_iters iterations {
repeat inner_iters iterations {
step();
assert_eq(s, DUT.s);
}
step();
assert_eq(s, DUT.s);
}
DUT.a := X;
DUT.b := X;
assert_eq(s, DUT.s);
fork();
step();
}
Since the bi and monitor share the same test cases in test_catalog.py, I added this here just ot make it consistent with the monitor tests (this is also what is done in the existing monitor_runt_command function in generate_runt_configs.py). I can get rid of this though if it is not needed for the BI -- I am thinking perhaps this is the case and this reveals a bug in the monitor.
I looked at the BI output for these test cases where the monitor times out and it says Cannot fork at step zero!, so I think this is somewhat related to the monitor bug #214 where it doesn't handle the case when a loop takes 0 iterations (i.e. we skip the loop) and we end up having a fork in cycle 0 (for the protocol above).
We should try to solve these cases instead of working around the problem. Either the protocol or the |
|
I would like to use the same |
|
@ekiwi Got it, thanks! I'll rework the |
Yeah, so I am pretty sure that there are some tests were the BI and the monitor disagree and I have not had the time yet to debug which one is wrong. |
|
Closing this PR as we are removing the monitor for now in #287 |
This PR addresses Kevin's comment here in #270, adding BI Runt tests to our testing framework / CI:
Most files changed in this PR are new
.expectfiles containing the BI output, the key code changes to review are:scripts/generate_runt_config.py(I followed Nikil's instructions in Migrate to Runt #252 to add support for Runt tests here. Note that the BI uses the same set of test cases as the monitor, i.e. the BI test suite usesMONITOR_CASESintest_catalog.py. This is possible since BI and monitor share largely the same CLI args.)bi/src/main.rs(described below)There are some minor changes to the
biexecutable in this PR:--color neverso that error messages are printed in plaintext (no color) in.expectfiles, like the monitorbipanics, instead of the default Rust error message:we instead print (and only save in
.expectfiles) the following:This avoids the OS thread ID (the
thread 'main' (11301631) ...information) in the default error message from appearing in the.expectfiles, since the OS thread ID changes every time we run the executable.Two test infra TODOs for future PRs
.expectfile only displays the error code:Ideally, we change this behavior so that monitor error messages are also captured in
.expectfiles (matching what is done forbiin this PR). This is a one-line change ingenerate_runt_configs.py, but also affects a bunch of.expectfiles, so I wanted to defer it to a subsequent PR.axi-lite-s1bug #270 that:To implement this, we have to adapt
generate_runt_configs.pyso that for the Brave New World test cases, one single.protcan correspond to multiple.expectfiles (different output for buggy / fixed waveforms). This is doable, but I'd like to defer this to a future PR since it will modify (remove) a bunch of.expectfiles.