Skip to content

Comments

Fix flaky cache test#6373

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

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

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
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
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
Contributor

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
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

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
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