Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions toolchain/driver/runtimes_cache_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,12 @@ TEST_F(RuntimesCacheTest, LookupWithManyStaleRuntimes) {
// Get the Unix-like inode of the directories so we can check whether
// subsequent lookups create a new directory.
auto runtimes1_inode = runtimes1.base_dir().Stat()->unix_inode();
auto stale_runtimes_0_inode =
stale_runtimes[0].base_dir().Stat()->unix_inode();
Comment on lines -612 to -613
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.

auto runtimes2_inode = runtimes2.base_dir().Stat()->unix_inode();

// Use the modification time for the stale runtime as comparing inodes gives a
// false failure when the filesystem reuses the inode.
auto stale_runtimes_0_mtime = stale_runtimes[0].base_dir().Stat()->mtime();

// Now adjust their age backwards in time by two years to make them very, very
// stale.
auto now = Filesystem::Clock::now();
Expand Down Expand Up @@ -640,8 +642,8 @@ TEST_F(RuntimesCacheTest, LookupWithManyStaleRuntimes) {
EXPECT_THAT(runtimes2.base_dir().Stat()->unix_inode(), Eq(runtimes2_inode));

// One of the stale runtimes should be freshly created though.
EXPECT_THAT(stale_runtimes_0.base_dir().Stat()->unix_inode(),
Ne(stale_runtimes_0_inode));
EXPECT_THAT(stale_runtimes_0.base_dir().Stat()->mtime(),
Ne(stale_runtimes_0_mtime));
}

TEST_F(RuntimesCacheTest, LookupWithTooManyRuntimes) {
Expand Down
Loading