Skip to content
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

Confirm that we don't trivially leak scorecards in any kind of finalize #6288

Closed
wants to merge 1 commit into from

Conversation

tempoz
Copy link
Contributor

@tempoz tempoz commented Apr 2, 2024

Modified tests to additionally confirm that we don't leak scorecards just because of a disconnect or retry.

Related issues: N/A

@@ -509,6 +513,10 @@ func TestHandleEventWithWorkspaceStatusBeforeStarted(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, "abc123", invocation.CommitSha)
assert.Equal(t, inspb.InvocationStatus_COMPLETE_INVOCATION_STATUS, invocation.InvocationStatus)

metrics, err := te.GetMetricsCollector().ReadCounts(ctx, "hit_tracker/"+testInvocationID)
Copy link
Member

@bduffany bduffany Apr 3, 2024

Choose a reason for hiding this comment

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

I think since we are creating "fake" builds by maually streaming BES events, we won't have any cache requests associated with the build, so this assertion would pass even if we didn't flush correctly (because the cache request data in the MetricsCollector will be empty)

The testenv should have a cache client available as te.GetPooledByteStreamClient(), so it might work to create a dedicated test that opens a BES stream, uploads a blob (cachetools.UploadBlob) then downloads the blob (with the invocation ID set in RequestMetadata, so that it gets associated with the BES stream - can use bazel_request.WithRequestMetadata for the DownloadBlob ctx), then making assertions on the counts before/after calling finalize

@tempoz tempoz closed this May 14, 2024
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.

None yet

2 participants