Skip to content

Commit

Permalink
e2e/framework network: exit early in DialFromContainer
Browse files Browse the repository at this point in the history
Immediately exit on receiving an unexpected response, we currently
wait for all the attempts to be exhausted and then return an error.

Signed-off-by: Daman Arora <aroradaman@gmail.com>
  • Loading branch information
aroradaman committed Apr 27, 2024
1 parent 0b9118b commit 20d335a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/framework/network/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ func (config *NetworkingTestConfig) DialFromContainer(ctx context.Context, proto
responses.Insert(trimmed)
}
}
if responses.Difference(expectedResponses).Len() > 0 {
returnMsg := fmt.Errorf("received unexpected responses... \nAttempt %d\nCommand %v\nretrieved %v\nexpected %v", i, cmd, responses, expectedResponses)
framework.Logf("encountered error during dial (%v)", returnMsg)
return returnMsg
}

framework.Logf("Waiting for responses: %v", expectedResponses.Difference(responses))

// Check against i+1 so we exit if minTries == maxTries.
Expand Down

0 comments on commit 20d335a

Please sign in to comment.