Skip to content

Commit

Permalink
♻️ Fix race condition
Browse files Browse the repository at this point in the history
Signed-off-by: vankichi <kyukawa315@gmail.com>
  • Loading branch information
vankichi committed Jan 16, 2025
1 parent be7b4de commit fdc3b87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions tests/e2e/crud/crud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,16 +1039,18 @@ func TestE2EAgentRolloutRestart(t *testing.T) {
done := make(chan struct{})
go func() {
defer wg.Done()
var ierr error

for {
select {
case <-done:
return
default:
err = searchFunc()
if err != nil {
st, ok := status.FromError(err)
ierr = searchFunc()
if ierr != nil {
st, ok := status.FromError(ierr)
if ok && st.Code() == codes.DeadlineExceeded {
_, _, rerr := status.ParseError(err, codes.DeadlineExceeded, "an error occurred")
_, _, rerr := status.ParseError(ierr, codes.DeadlineExceeded, "an error occurred")
mu.Lock()
serr = errors.Join(serr, rerr)
mu.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/operation/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (c *client) getGRPCConn() (*grpc.ClientConn, error) {
grpc.WithInsecure(),
grpc.WithKeepaliveParams(
keepalive.ClientParameters{
Time: time.Second,
Time: 10 * time.Minute,
Timeout: 60 * time.Second,
PermitWithoutStream: true,
},
Expand Down

0 comments on commit fdc3b87

Please sign in to comment.