Skip to content

[Tests] fix flaky TestContainerAllocatorWithHostAffinity.testExpiredRequestAllocationOnAnyHost#1559

Merged
cameronlee314 merged 1 commit intoapache:masterfrom
cameronlee314:alloctest2
Nov 16, 2021
Merged

[Tests] fix flaky TestContainerAllocatorWithHostAffinity.testExpiredRequestAllocationOnAnyHost#1559
cameronlee314 merged 1 commit intoapache:masterfrom
cameronlee314:alloctest2

Conversation

@cameronlee314
Copy link
Contributor

@cameronlee314 cameronlee314 commented Nov 15, 2021

Issue: TestContainerAllocatorWithHostAffinity.testExpiredRequestAllocationOnAnyHost transiently fails. The test comments say it should check for "at least 2" cancelled resource requests and "at least 2" ANY_HOST requests, 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 up ANY_HOST request to also get cancelled. Parts of the test seem to indicate that it is not the intention to check on the follow up ANY_HOST requests, but the validation logic relied on the follow up ANY_HOST expirations. In #1556, the test was updated to wait 1000ms with an expiration timeout of 500ms, so this barely left enough time for the follow-up ANY_HOST expiration.
Changes: Updated the test to wait longer so the follow-up ANY_HOST expirations can happen, and explicitly check for ANY_HOST expirations (also updated comments to reflect the explicit check).
Tests: Unit test passes
API changes: N/A

Copy link
Contributor

@Sanil15 Sanil15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cameronlee314 cameronlee314 merged commit 39f6530 into apache:master Nov 16, 2021
ehoner pushed a commit to ehoner/samza that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants