[Tests] fix flaky TestContainerAllocatorWithHostAffinity.testExpiredRequestAllocationOnAnyHost#1559
Merged
cameronlee314 merged 1 commit intoapache:masterfrom Nov 16, 2021
Merged
Conversation
…equestAllocationOnAnyHost
ehoner
pushed a commit
to ehoner/samza
that referenced
this pull request
Apr 11, 2023
…equestAllocationOnAnyHost (apache#1559)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue:
TestContainerAllocatorWithHostAffinity.testExpiredRequestAllocationOnAnyHosttransiently fails. The test comments say it should check for "at least 2" cancelled resource requests and "at least 2"ANY_HOSTrequests, but the actual logic checks for "greater than 2". Usually, the test passes, because the 2 preferred host requests get cancelled, and then there is time for the follow upANY_HOSTrequest to also get cancelled. Parts of the test seem to indicate that it is not the intention to check on the follow upANY_HOSTrequests, but the validation logic relied on the follow upANY_HOSTexpirations. In #1556, the test was updated to wait 1000ms with an expiration timeout of 500ms, so this barely left enough time for the follow-upANY_HOSTexpiration.Changes: Updated the test to wait longer so the follow-up
ANY_HOSTexpirations can happen, and explicitly check forANY_HOSTexpirations (also updated comments to reflect the explicit check).Tests: Unit test passes
API changes: N/A