Skip to content

Fix flaky cache test#6373

Closed
aw-andre wants to merge 2 commits intocarbon-language:trunkfrom
aw-andre:fix-cache-test
Closed

Fix flaky cache test#6373
aw-andre wants to merge 2 commits intocarbon-language:trunkfrom
aw-andre:fix-cache-test

Conversation

@aw-andre
Copy link
Copy Markdown

Fixes a flaky test in runtimes_cache_test.cpp that gives a false failure when the filesystem reuses the inode of a stale cache entry.

Closes #6168

@aw-andre aw-andre requested a review from a team as a code owner November 14, 2025 03:13
@aw-andre aw-andre requested review from josh11b and removed request for a team November 14, 2025 03:13
Comment thread toolchain/driver/runtimes_cache_test.cpp Outdated
Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
Comment on lines -612 to -613
auto stale_runtimes_0_inode =
stale_runtimes[0].base_dir().Stat()->unix_inode();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this will no longer compile.

Comment on lines +645 to +648
EXPECT_FALSE(stale_runtimes_0.base_dir().Stat()->unix_inode()
== stale_runtimes_0_inode &&
stale_runtimes_0.base_dir().Stat()->mtime()
== stale_runtimes_0_mtime);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[diff] reported by reviewdog 🐶

Suggested change
EXPECT_FALSE(stale_runtimes_0.base_dir().Stat()->unix_inode()
== stale_runtimes_0_inode &&
stale_runtimes_0.base_dir().Stat()->mtime()
== stale_runtimes_0_mtime);
EXPECT_FALSE(stale_runtimes_0.base_dir().Stat()->unix_inode() ==
stale_runtimes_0_inode &&
stale_runtimes_0.base_dir().Stat()->mtime() ==
stale_runtimes_0_mtime);

@chandlerc
Copy link
Copy Markdown
Contributor

I don't think this is quite the right way to fix the test. Rather than relying on timestamps, we can force the inode to not be re-used. (I hope.)

I've sent #6387 which does this, and also makes some other improvements to make it easier to debug if this keeps happening.

@github-actions
Copy link
Copy Markdown

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please comment or remove the inactive label.

This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.

@github-actions github-actions Bot added the inactive Issues and PRs which have been inactive for at least 90 days. label Feb 16, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active or becomes active again, please reopen it.

This PR was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

@github-actions github-actions Bot closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inactive Issues and PRs which have been inactive for at least 90 days. toolchain

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants