knurling-rs / probe-run

Run embedded programs just like native ones
Apache License 2.0
646 stars 75 forks source link

Snapshot test `panic_verbose` fails wrongfully #336

Open Urhengulas opened 2 years ago

Urhengulas commented 2 years ago

Problem

The snapshot test panic_verbose fails wrongfully most of the times, because it's output contains timing related numbers, which slightly change between runs.

-   22       │-(HOST) TRACE reading canary took 0.010s (104.18 KiB/s)
+         22 │+(HOST) TRACE reading canary took 0.013s (75.06 KiB/s)

You can reproduce this by connecting your computer to an nrf52-dk and executing cargo test -- --ignored.

Workaround

It is currently disabled, by marking it as #[should_panic].

Solution

Filter out the timing related numbers from the output. Either filter out the full lines, or, what would be preferable, replace just the numbers with a placeholder (e.g. #).

-   22       │-(HOST) TRACE reading canary took 0.010s (104.18 KiB/s)
+         22 │+(HOST) TRACE reading canary #s (# KiB/s)