Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following test has been failing a couple of times
Analysing the runs (example run 1, example run 2) in more detail it can be seen that the test expects the local targets to be empty, but they contain the entries of the second cluster:
This doesn't make sense. The app had 0 replicas in both clusters, and then the app was scaled out in the second cluster, so the expected targets should be the IP addresses of the second cluster. This is also what the test tries to verify:
It can then be concluded that
usLocalTargets
is empty. This was double checked by adding some debug statements in the following build.The
usLocalTargets
variable is populated by callinginstanceUS.GetLocalTargets()
, and the test tries to make sure it is not empty by callingWaitForAppIsRunning()
beforehand. This functionWaitForAppIsRunning() waits until the
DNSEndpoint` resource is populated, however it does not verify if coredns picked up these values. This operation should be very fast, but apparently the test execution is sometimes too quick, ending up with empty results.To fix the above, this PR adds a step to
WaitForAppIsRunning()
where it verifies if coredns picked up the entries. I am very confidant this will solve the flaky test. If that is not the case at least we will have additional log data to see how quickly coredns takes to pick up entries configured viaDNSEndpoint
resources.