Skip to content

invocation_target_group_card: show cache status #9457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

sluongng
Copy link
Contributor

@sluongng sluongng commented May 23, 2025

Adds a badge next to the target label in the invocation targets
list to display test cache status information.

The badge shows "Cached" if all runs were served from cache.
Nothing is displayed if only some of the runs, or none were cached.

Note that we are not currently using test cache status to sort the
target group. Such logic can be added later in a future change. Also,
there is insufficient information from Build Event Stream to indicate
whether a build target was cached or not, so all build targets are being
shown without the badge, which could be misinterpreted as no-cache.

@sluongng sluongng requested review from bduffany and fmeum May 23, 2025 11:50
@sluongng
Copy link
Contributor Author

image

Quick preview

@sluongng sluongng force-pushed the sluongng/show-test-target-cache-status branch 2 times, most recently from 43872ce to 439fd8b Compare May 23, 2025 12:03
@sluongng
Copy link
Contributor Author

image

With some manual AC deletion in local disk_cache, I was able to produce a cache miss for 1/3 shards.

Worth noting that --runs_per_test=3 can get a disk cache hit, but it would not be shown in TestSummary or TestResult event as cached.

@sluongng
Copy link
Contributor Author

Hmm does 2 / 3 runs cached sound better here? 🤔

@sluongng sluongng force-pushed the sluongng/show-test-target-cache-status branch from 439fd8b to d791e0c Compare May 23, 2025 12:19
@brentleyjones
Copy link
Contributor

brentleyjones commented May 23, 2025

Also, there is insufficient information from Build Event Stream to indicate whether a build target was cached or not, so all build targets are being shown without the badge, which could be misinterpreted as no-cache.

The Bazel log output only really shows (cached) on test summaries, so I think only showing this badge on test rows isn't too confusing.

@sluongng sluongng force-pushed the sluongng/show-test-target-cache-status branch from d791e0c to 3d95baf Compare May 27, 2025 09:38
@sluongng
Copy link
Contributor Author

image

Hmm, I don't like the width increase for each of these run-grid items.

@sluongng sluongng force-pushed the sluongng/show-test-target-cache-status branch 2 times, most recently from fa274b4 to b763e7f Compare June 2, 2025 07:16
Adds a badge next to the target label in the invocation targets
list to display test cache status information.

The badge shows "Cached" if all runs were served from cache.
It shows "X cached / Y runs" if some runs were cached, where X
is the number of cached runs and Y is the total number of runs.
This case is relatively rare as test shards, runs and attempts usually
share the same cache TTL.

Nothing is displayed if no runs were cached.

Note that we are not currently using test cache status to sort the
target group. Such logic can be added later in a future change. Also,
there is insufficient information from Build Event Stream to indicate
whether a build target was cached or not, so all build targets are being
shown without the badge, which could be misinterpreted as no-cache.
@sluongng sluongng force-pushed the sluongng/show-test-target-cache-status branch from b763e7f to 432b067 Compare June 3, 2025 17:24
@sluongng sluongng requested review from bduffany and fmeum June 4, 2025 11:08
@sluongng sluongng merged commit 35e6feb into master Jun 4, 2025
15 checks passed
@sluongng sluongng deleted the sluongng/show-test-target-cache-status branch June 4, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants