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

Remove v1alpha1 Runs Client setup in init test #6571

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ type clients struct {
V1beta1TaskRunClient v1beta1.TaskRunInterface
V1beta1PipelineRunClient v1beta1.PipelineRunInterface
V1beta1CustomRunClient v1beta1.CustomRunInterface
V1alpha1RunClient v1alpha1.RunInterface
V1alpha1ResolutionRequestclient resolutionv1alpha1.ResolutionRequestInterface
V1alpha1VerificationPolicyClient v1alpha1.VerificationPolicyInterface
V1PipelineClient v1.PipelineInterface
Expand Down
9 changes: 0 additions & 9 deletions test/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,6 @@ func getCRDYaml(ctx context.Context, cs *clients, ns string) ([]byte, error) {
printOrAdd(i)
}

v1alpha1Runs, err := cs.V1alpha1RunClient.List(ctx, metav1.ListOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

I may be missing some context here.

If this is panicking, shouldn't we try to fix the panic instead of removing this part of the test altogether? (my assumption is because the client isn't present?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Billy. I was mistaken thought that with the removal of clients setup at

pipeline/test/clients.go

Lines 101 to 112 in a7424c4

c.V1beta1PipelineClient = cs.TektonV1beta1().Pipelines(namespace)
c.V1beta1ClusterTaskClient = cs.TektonV1beta1().ClusterTasks()
c.V1beta1TaskClient = cs.TektonV1beta1().Tasks(namespace)
c.V1beta1TaskRunClient = cs.TektonV1beta1().TaskRuns(namespace)
c.V1beta1PipelineRunClient = cs.TektonV1beta1().PipelineRuns(namespace)
c.V1beta1CustomRunClient = cs.TektonV1beta1().CustomRuns(namespace)
c.V1alpha1ResolutionRequestclient = rrcs.ResolutionV1alpha1().ResolutionRequests(namespace)
c.V1alpha1VerificationPolicyClient = cs.TektonV1alpha1().VerificationPolicies(namespace)
c.V1PipelineClient = cs.TektonV1().Pipelines(namespace)
c.V1TaskClient = cs.TektonV1().Tasks(namespace)
c.V1TaskRunClient = cs.TektonV1().TaskRuns(namespace)
c.V1PipelineRunClient = cs.TektonV1().PipelineRuns(namespace)
for TEP114, this would not be necessary moving forward.

Copy link
Member Author

Choose a reason for hiding this comment

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

when running the following e2e test on local branch the following error occured.
Currently debugging through the reason why it failed but I think the removed line 294 in init_test could be the reason it failed

± |v1-storage → origin ↑1 ↓2 {51} U:2 ✗| → go test -v -tags=e2e -count=1 ./test -run ^TestLargerResultsSidecarLogs
=== RUN   TestLargerResultsSidecarLogs
=== PAUSE TestLargerResultsSidecarLogs
=== CONT  TestLargerResultsSidecarLogs
=== RUN   TestLargerResultsSidecarLogs/larger_results_via_sidecar_logs
=== PAUSE TestLargerResultsSidecarLogs/larger_results_via_sidecar_logs
=== CONT  TestLargerResultsSidecarLogs/larger_results_via_sidecar_logs
    larger_results_sidecar_logs_test.go:69: Create namespace arendelle-qtjd7 to deploy to
    larger_results_sidecar_logs_test.go:69: Verify SA "default" is created in namespace "arendelle-qtjd7"
    larger_results_sidecar_logs_test.go:74: Setting up test resources for "larger results via sidecar logs" test in namespace arendelle-qtjd7
    larger_results_sidecar_logs_test.go:82: Waiting for PipelineRun larger-results-sidecar-logs in namespace arendelle-qtjd7 to complete
    larger_results_sidecar_logs_test.go:84: Error waiting for PipelineRun larger-results-sidecar-logs to finish: "larger-results-sidecar-logs" failed
    panic.go:522: ############################################
    panic.go:522: ### Dumping objects from arendelle-qtjd7 ###
    panic.go:522: ############################################
--- FAIL: TestLargerResultsSidecarLogs (14.11s)
    --- FAIL: TestLargerResultsSidecarLogs/larger_results_via_sidecar_logs (14.11s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x38 pc=0x103dfed20]
 
goroutine 12 [running]:
testing.tRunner.func1.2({0x1044ec4a0, 0x105cf9360})
	/usr/local/go/src/testing/testing.go:1526 +0x1c8
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1529 +0x384
panic({0x1044ec4a0, 0x105cf9360})
	/usr/local/go/src/runtime/panic.go:884 +0x204
github.com/tektoncd/pipeline/test.getCRDYaml({0x104924b98, 0x1400036fd10}, 0x14000328b60, {0x14000304d30, 0xf})
	/Users/jeromeju/go/src/github.com/tektoncd/pipeline/test/init_test.go:294 +0xab0
github.com/tektoncd/pipeline/test.tearDown({0x104924b98, 0x1400036fd10}, 0x14000573520, 0x14000328b60, {0x14000304d30, 0xf})
	/Users/jeromeju/go/src/github.com/tektoncd/pipeline/test/init_test.go:98 +0xc0
runtime.Goexit()
	/usr/local/go/src/runtime/panic.go:522 +0x180
testing.(*common).FailNow(0x14000573520)
	/usr/local/go/src/testing/testing.go:980 +0x44
testing.(*common).Fatalf(0x14000573520, {0x103e9a76d?, 0x14000328b60?}, {0x14000d1fef0?, 0x1b?, 0x0?})
	/usr/local/go/src/testing/testing.go:1064 +0x60
github.com/tektoncd/pipeline/test.TestLargerResultsSidecarLogs.func1(0x14000573520)
	/Users/jeromeju/go/src/github.com/tektoncd/pipeline/test/larger_results_sidecar_logs_test.go:84 +0x4b8
testing.tRunner(0x14000573520, 0x14000945290)
	/usr/local/go/src/testing/testing.go:1576 +0x10c
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1629 +0x368
FAIL	github.com/tektoncd/pipeline/test	15.322s
FAIL

Copy link
Member

Choose a reason for hiding this comment

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

I'm noticing this on other PRs too, for example https://storage.googleapis.com/tekton-prow/pr-logs/pull/tektoncd_pipeline/6516/pull-tekton-pipeline-alpha-integration-tests/1649485487607386112/build-log.txt

It seems like this was introduced by #6508, but I'm not sure why it is nondeterministic

if err != nil {
return nil, fmt.Errorf("could not get v1alpha1 runs: %w", err)
}
for _, i := range v1alpha1Runs.Items {
i.SetManagedFields(nil)
printOrAdd(i)
}

v1beta1CustomRuns, err := cs.V1beta1CustomRunClient.List(ctx, metav1.ListOptions{})
if err != nil {
return nil, fmt.Errorf("could not get v1beta1 customruns: %w", err)
Expand Down