Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-1.26] Fix racy leader pool test #3126

Merged
merged 1 commit into from May 18, 2023

Conversation

k0s-bot
Copy link

@k0s-bot k0s-bot commented May 17, 2023

Automated backport to release-1.26, triggered by a label in #3039.
See .

The TestSecondWatcherAcquiresReleasedLease test was racy concerning
which of the two pools would acquire the lease first. As a result,
the test would either fail due to an unexpected event order, or hang
until aborted because the pools wouldn't emit enough events for the
event collection loop to terminate. This behavior was apparently only
observable on Windows.

Fix this by adding appropriate values for AcquireTime, RenewTime and
LeaseDurationSeconds to the pre-created lease, so that it properly
reflects its acquisition by the first pool.

Also remove the namespace and pool creations from the other tests, as
they were unnecessary. Inline the last required lease creation into the
racy test case.

Remove the WithRenewDeadline options from the pools under test, as they
didn't have any impact on the test, neither semantically nor in terms
of execution times. Reduce the RetryPeriod to 10 milliseconds to provide
even more immediate test feedback. Rename some local variables and
rephrase some log strings to make them more consistent.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
(cherry picked from commit 544307d)
(cherry picked from commit b97c0ef)
@k0s-bot k0s-bot requested a review from a team as a code owner May 17, 2023 12:54
@twz123 twz123 changed the title [Backport release-1.26] [Backport release-1.27] Fix racy leader pool test [Backport release-1.26] Fix racy leader pool test May 17, 2023
@twz123 twz123 added chore backport/release-1.25 PR that needs to be backported/cherrypicked to release-1.25 branch labels May 17, 2023
@juanluisvaladas juanluisvaladas merged commit 8c55c8e into release-1.26 May 18, 2023
68 checks passed
@juanluisvaladas juanluisvaladas deleted the backport-3039-to-release-1.26 branch May 18, 2023 08:32
@k0s-bot
Copy link
Author

k0s-bot commented May 18, 2023

Successfully created backport PR #3130 for release-1.25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/release-1.25 PR that needs to be backported/cherrypicked to release-1.25 branch chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants