-
Notifications
You must be signed in to change notification settings - Fork 73
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(flaky): ensure that the space is always unblocked for its deletion #1090
Open
MatousJobanek
wants to merge
3
commits into
codeready-toolchain:master
Choose a base branch
from
MatousJobanek:fix-flaky-blocked-space-deletion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... what's the point of using
Once
here? resetOnce.Do() will be called a single time only (for this specific resetOnce instance) anyway. What am I missing?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to ensure that this reset is called only once - either as part of the sub-test or at the end of the test. If it happens that the sub-test (that resets the target cluster) is called, then the space would be deleted - see:
toolchain-e2e/test/e2e/parallel/space_test.go
Lines 112 to 120 in de8dd00
so the space wouldn't be present anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or were you were asking why do I define the variable
resetOnce
outside of the function? Well, the variable has to stay outside, so when the function is called, it always uses the same instance of theOnce
. If it was moved inside of the function, then it would create a new instance ofOnce
for every call of the functionThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be a problem - but should we move this definition in the parent test
TestCreateSpace
( where we defineawaitilities
,hostAwait
,memberAwait
) ? Just to be on the safe side.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was missing is that the
reset()
was called twice (not once!). Once in the defer and the second time in the sub-test bellow. I saw it only in called by defer and was wondering why do you needonce
if it's already called only once :)Sorry for the confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really, it has to stay in the same (sub)test where the space is provisioned, so it's tied to the actual space (and also the the function that executes this sub-test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense , thanks for explaining that 👍