Skip to content

Flaky test: dotnet_trx test_parse_trx_files_in_dir_since_ignores_older_files depends on file mtimes #4037

Closed

Description

@KuSh

Summary

cmds::dotnet::dotnet_trx::tests::test_parse_trx_files_in_dir_since_ignores_older_files fails intermittently. It is not tied to any change — it flakes on unmodified develop-era trees.

thread '…test_parse_trx_files_in_dir_since_ignores_older_files' panicked at
src/cmds/dotnet/dotnet_trx.rs:576:75:
merged summary

Reproduction

Run it repeatedly in isolation:

cargo test --bin rtk test_parse_trx_files_in_dir_since_ignores_older_files

Observed rates on this machine:

So it is pre-existing and independent of the code under test in either tree.

Likely cause

The test name says it: it filters TRX files by "since" a timestamp, so it depends on file mtimes. Files written within the same clock tick — or a filesystem whose mtime granularity is coarser than the test assumes — make "older" and "newer" indistinguishable, and the .expect("merged summary") at dotnet_trx.rs:576 then unwraps a None.

A fixed, explicitly-set mtime on the fixture files, rather than one derived from write order, would make it deterministic.

Why it is worth fixing

It is a false red in CI on an unrelated PR, which is the kind of failure that trains reviewers to re-run rather than read.

Activity

  1. rtk-wshm-sync-bot commented on Sep 13, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 85%

    Summary

    Flaky unit test depends on file mtime granularity; fix by setting explicit mtimes on fixture files rather than relying on write-order timing.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • src/cmds/dotnet/dotnet_trx.rs

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  2. TechWizard9999 commented on Sep 14, 2026

    @TechWizard9999
    Contributor

    Hi @KuSh , Can I work on this issue ?

  3. KuSh commented on Sep 14, 2026

    @KuSh
    CollaboratorAuthor

    Hi @KuSh , Can I work on this issue ?

    Sure!

  4. TechWizard9999 commented on Sep 14, 2026

    @TechWizard9999
    Contributor

    @KuSh I have raised an pr could you please reveiw this ? whenever you are free

  5. added 2 commits that reference this issue on Sep 14, 2026
    e174518
    9082031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:testingbuggood first issuepriority:medium

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions