Skip to content

Commit

Permalink
Fix SyncAuthorizedEntries test race (#4769)
Browse files Browse the repository at this point in the history
The SyncAuthorizedEntries test is set up to optionally send a request,
depending on the expectations of the test case. The "no caller ID" and
"fetcher fails" test cases are currently set up to send the request on
the stream. However, in this instances, the handler exits before reading
the request off the stream due to the respective expected failures.
Timing conditions still allowed the requests to be sent successfully
most of the time but caused intermittent failures, particularly when
being run in resource constrained environments (e.g. GH actions).

This change fixes the test cases by not attempting to send the request
on the stream.

Signed-off-by: Andrew Harding <azdagron@gmail.com>
  • Loading branch information
azdagron authored Jan 3, 2024
1 parent 1148b9f commit e1099fe
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions pkg/server/api/entry/v1/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3190,7 +3190,6 @@ func TestSyncAuthorizedEntries(t *testing.T) {
name: "no caller id",
steps: []step{
{
req: &entryv1.SyncAuthorizedEntriesRequest{},
err: "caller ID missing from request context",
code: codes.Internal,
},
Expand All @@ -3217,7 +3216,6 @@ func TestSyncAuthorizedEntries(t *testing.T) {
name: "fetcher fails",
steps: []step{
{
req: &entryv1.SyncAuthorizedEntriesRequest{},
err: "failed to fetch entries",
code: codes.Internal,
},
Expand Down

0 comments on commit e1099fe

Please sign in to comment.