-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Poll multiple times that the pvc is deleted in TestPipelineRun #916
Conversation
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.
Sounds good to me
cc @abayer
/lgtm Thanks! |
/hold |
de2e035
to
5a86d48
Compare
/lgtm |
/hold cancel Should work know, not 100% sure but the future will hold truth |
...I really wrote a lousy test, didn't I. =) |
@abayer arf not it's fine, there is way worse things :) |
5a86d48
to
cde21fc
Compare
test/pipelinerun_test.go
Outdated
return true, fmt.Errorf("Error looking up PVC %s for PipelineRun %s: %s", artifacts.GetPVCName(pipelineRun), prName, errWait) | ||
} | ||
return pvc.DeletionTimestamp == nil, errWait | ||
}); err != nil { | ||
if !errors.IsNotFound(err) { |
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.
🤔 shouldn't that check be in the PollImmediate
? (and returning true
+ nil
as error) so that we don't have to do the check twice ?
test/pipelinerun_test.go
Outdated
if errWait != nil && !errors.IsNotFound(errWait) { | ||
return true, fmt.Errorf("Error looking up PVC %s for PipelineRun %s: %s", artifacts.GetPVCName(pipelineRun), prName, errWait) | ||
} | ||
return pvc.DeletionTimestamp == nil, errWait |
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.
I don't think we need to return errWait
here, as it's only be IsNotFound
as an error, and in this case, we don't want it to fail (as it's already gone)
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.
👍
Seems like it works when testing the test locally % go test -failfast -v -count=1 -tags=e2e -ldflags '-X github.com/tektoncd/pipeline/test.missingKoFatal=false' ./test -timeout=20m --kubeconfig $KUBECONFIG -run TestPipelineRun/service_account_propagation 2>&1 |tee /tmp/log
Using kubeconfig at `/Users/chmouel/.kube/config` with cluster ``
=== RUN TestPipelineRun
=== PAUSE TestPipelineRun
=== RUN TestPipelineRunTimeout
2019-05-29T10:35:01.537+0200 info logging/config.go:39 Successfully created the logger. {"knative.dev/jsonconfig": "{\n\t \"level\": \"info\",\n\t \"encoding\": \"console\",\n\t \"outputPaths\": [\"stdout\"],\n\t \"errorOutputPaths\": [\"stderr\"],\n\t \"encoderConfig\": {\n\t \"timeKey\": \"ts\",\n\t \"messageKey\": \"message\",\n\t \"levelKey\": \"level\",\n\t \"nameKey\": \"logger\",\n\t \"callerKey\": \"caller\",\n\t \"messageKey\": \"msg\",\n\t \"stacktraceKey\": \"stacktrace\",\n\t \"lineEnding\": \"\",\n\t \"levelEncoder\": \"\",\n\t \"timeEncoder\": \"iso8601\",\n\t \"durationEncoder\": \"\",\n\t \"callerEncoder\": \"\"\n\t }\n\t}"}
2019-05-29T10:35:01.537+0200 info logging/config.go:39 Logging level set to info
2019-05-29T10:35:01.537+0200 warn logging/config.go:41 Fetch GitHub commit ID from kodata failed: "KO_DATA_PATH" does not exist or is empty
=== PAUSE TestPipelineRunTimeout
=== RUN TestPipelineRunFailedAndRetry
=== PAUSE TestPipelineRunFailedAndRetry
=== CONT TestPipelineRun
=== CONT TestPipelineRunTimeout
=== CONT TestPipelineRunFailedAndRetry
=== RUN TestPipelineRun/service_account_propagation
=== PAUSE TestPipelineRun/service_account_propagation
=== CONT TestPipelineRun/service_account_propagation
--- PASS: TestPipelineRun (0.00s)
--- PASS: TestPipelineRun/service_account_propagation (35.85s)
init_test.go:100: Create namespace arendelle-lqhsw to deploy to
init_test.go:112: Verify SA "default" is created in namespace "arendelle-lqhsw"
pipelinerun_test.go:127: Setting up test resources for "service account propagation" test in namespace arendelle-lqhsw
pipelinerun_test.go:136: Waiting for PipelineRun pipelinerun1 in namespace arendelle-lqhsw to complete
pipelinerun_test.go:141: Making sure the expected TaskRuns [task1] were created
pipelinerun_test.go:164: Checking that labels were propagated correctly for TaskRun pipelinerun1-task1-wq69c
pipelinerun_test.go:170: Making sure 2 events were created from taskrun and pipelinerun with kinds map[PipelineRun:[pipelinerun1] TaskRun:[pipelinerun1-task1-wq69c]]
pipelinerun_test.go:194: Successfully finished test "service account propagation"
pipelinerun_test.go:195: Deleting namespace arendelle-lqhsw
--- PASS: TestPipelineRunTimeout (39.58s)
init_test.go:100: Create namespace arendelle-zttbd to deploy to
init_test.go:112: Verify SA "default" is created in namespace "arendelle-zttbd"
timeout_test.go:43: Creating Task in namespace arendelle-zttbd
timeout_test.go:63: Waiting for Pipelinerun pear in namespace arendelle-zttbd to be started
timeout_test.go:83: Waiting for TaskRuns from PipelineRun pear in namespace arendelle-zttbd to be running
timeout_test.go:114: Waiting for PipelineRun pear in namespace arendelle-zttbd to be timed out
timeout_test.go:132: Waiting for TaskRuns from PipelineRun pear in namespace arendelle-zttbd to be cancelled
timeout_test.go:175: Waiting for PipelineRun kiwi in namespace arendelle-zttbd to complete
timeout_test.go:179: Deleting namespace arendelle-zttbd
--- PASS: TestPipelineRunFailedAndRetry (47.15s)
init_test.go:100: Create namespace arendelle-7zhwf to deploy to
init_test.go:112: Verify SA "default" is created in namespace "arendelle-7zhwf"
timeout_test.go:189: Creating Task in namespace arendelle-7zhwf
timeout_test.go:208: Waiting for Pipelinerun pear in namespace arendelle-7zhwf to be started
timeout_test.go:231: Deleting namespace arendelle-7zhwf
PASS
ok github.com/tektoncd/pipeline/test 47.777s I am going to increase the timeout and see if that changes things |
4a41fe5
to
30e2725
Compare
/hold still working on this, |
/test pull-tekton-pipeline-integration-tests |
1 similar comment
/test pull-tekton-pipeline-integration-tests |
66b3db8
to
8b5c155
Compare
/hold cancel yay this should now!! it took me a while to figure out because between my local dev env on openshift4 and on CI/k8 the behavior seems to be different, the volume are around a longer time after the test in OS4 |
8b5c155
to
3c65e1e
Compare
Let's poll for up to 10mn that the PersistentVolumeClaims has the DeletionTimestamp set. Fixes tektoncd#915 Signed-off-by: Chmouel Boudjnah <[email protected]>
3c65e1e
to
c68128c
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chmouel, vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Let's poll for up to 10mn that the PersistentVolumeClaims has the
DeletionTimestamp set.
Fixes #915
Signed-off-by: Chmouel Boudjnah [email protected]
Changes
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them: