e2e/framework network: exit early in DialFromContainer
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>
This commit is contained in:
		@@ -325,6 +325,12 @@ func (config *NetworkingTestConfig) DialFromContainer(ctx context.Context, proto
 | 
				
			|||||||
				responses.Insert(trimmed)
 | 
									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))
 | 
							framework.Logf("Waiting for responses: %v", expectedResponses.Difference(responses))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Check against i+1 so we exit if minTries == maxTries.
 | 
							// Check against i+1 so we exit if minTries == maxTries.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user