Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Snapshot test panic_verbose fails wrongfully #336

Open
Urhengulas opened this issue Jul 27, 2022 · 0 comments
Open

Snapshot test panic_verbose fails wrongfully #336

Urhengulas opened this issue Jul 27, 2022 · 0 comments
Labels
type: bug Something isn't working

Comments

@Urhengulas
Copy link
Member

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)
@Urhengulas Urhengulas added the type: bug Something isn't working label Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant