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

Fix hive test argument order and race #25545

Merged
merged 2 commits into from May 24, 2023

Conversation

bimmlerd
Copy link
Member

Minor tweaks to hive test to fix argument order to Equals calls, and fix a race which could fail tests.

Confusingly, assert.Equal takes 'expected' before 'actual'. Fixing this
helps making test errors easier to debug, since there assert explicitly
calls out what is 'expected'.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
Setting the stop timeout to a Millisecond creates a race in the handling
of the stop hooks in the lifecycle. Since we check that the stop context
is not expired before calling stop hooks, if the Millisecond timeout
expires before we run a single stop hook, the `stopped` counter is never
incremented. This manifests in the test failing with an actual count of
1, and is easily reproducible by inserting a short sleep before the
context Err check in lifecycle.go

We're primarily interested in the Start hooks timing out, hence only set
the start timeout to be short, and revert the stop timeout to it's
default value of a minute.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>
@bimmlerd bimmlerd added area/CI Continuous Integration testing issue or flake release-note/misc This PR makes changes that have no direct user impact. sig/agent Cilium agent related. labels May 19, 2023
@bimmlerd bimmlerd requested review from a team and lmb and removed request for a team May 19, 2023 08:31
@bimmlerd bimmlerd marked this pull request as ready for review May 19, 2023 08:36
@bimmlerd bimmlerd requested a review from a team as a code owner May 19, 2023 08:36
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@joamaki joamaki left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@bimmlerd
Copy link
Member Author

/test

@bimmlerd
Copy link
Member Author

With Jussis' approval I consider sig-foundations to be covered; removing review request for Lorenz.

@bimmlerd bimmlerd removed the request for review from lmb May 24, 2023 07:54
@bimmlerd bimmlerd added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 24, 2023
@squeed squeed merged commit 38fc009 into cilium:main May 24, 2023
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/CI Continuous Integration testing issue or flake ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact. sig/agent Cilium agent related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants