-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
test: fix flaky test TestOpenWorkspaceFromPrebuild #13170
Conversation
/werft run with-integration-tests=workspace 👍 started the job as gitpod-build-jenting-integration-tests-add-prebuilds-12638.12 |
cd9a3c2
to
1ae3708
Compare
/werft run with-integration-tests=workspace 👍 started the job as gitpod-build-jenting-integration-tests-add-prebuilds-12638.14 |
/werft run with-integration-tests=workspace wit-preview 👍 started the job as gitpod-build-jenting-integration-tests-add-prebuilds-12638.15 |
@jenting We need to |
But I have the preview env already. And this is only a test cases change. Should I still need the |
AFAI, yes, we need. |
/werft run with-integration-tests=workspace with-preview=true 👍 started the job as gitpod-build-jenting-integration-tests-add-prebuilds-12638.16 |
if lastStatus == nil || lastStatus.Conditions == nil || lastStatus.Conditions.VolumeSnapshot == nil { | ||
return "", nil, errors.New("cannot find the last snapshot") |
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.
Is this the root cause for flakey tests?
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.
Nope.
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.
Oops sorry, I wanted to ask if this code solved flaky.
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.
Several reasons for the flaky test happens, but the primary reason is that the prebuild log without the message 🤙 This task ran as a workspace prebuild
in /workspace/.gitpod/prebuild-log-*
. This message is written by the supervisor when running the prebuild workspace. Somehow, the message does not write into it. I increased the init task with 90 seconds of sleep and hope this will improve the message 🤙 This task ran as a workspace prebuild
be written into the /workspace/.gitpod/prebuild-log-*
.
If the above issue happens, we fall back to checking the init task message within /workspace/.gitpod/prebuild-log-*
.
If it still fails, we fall back to checking the someFile generated by the init task exists, this makes sure the workspace pod is created from prebuild, not from the git clone.
1ae3708
to
ce956ec
Compare
ce956ec
to
f9633e9
Compare
Signed-off-by: JenTing Hsiao <[email protected]>
38e40fd
to
2dfa983
Compare
Three test results |
// TestOpenWorkspaceFromPrebuild | ||
// - create a prebuild | ||
// - open the workspace from prebuild | ||
// - make sure the .git/ folder with correct permission | ||
// - make sure either one of the condition mets | ||
// - the prebuild log message exists | ||
// - the init task message exists | ||
// - the init task generated file exists | ||
// | ||
// - write a new file foobar.txt | ||
// - stop the workspace | ||
// - relaunch the workspace | ||
// - make sure the file foobar.txt exists |
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.
Add the test steps here, so we could more easily understand the test steps without tracing the code.
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.
Great!
Description
.git/
is not rootRelated Issue(s)
Related #12638
How to test
Release Notes
Documentation
None
Werft options:
Valid options are
all
,workspace
,webapp
,ide