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

Add Regression test for large number of Triggers #449

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

ncskier
Copy link
Member

@ncskier ncskier commented Feb 19, 2020

Changes

Fixes #405

Issue #356 found a bug in Triggers v0.1.0 (fixed in v0.2.0) where the
admission webhook times out after adding around 35 Triggers to an
EventListener.

This PR adds a regression test where we create an EventListener with
1000 Triggers.


I also moved the clean up code for cluster-scoped resources (from 7ba80a7) out of init_test.go and into eventlistener_test.go, because the code was cleaning up resources specific to the eventlistener_test.go. @dibyom do you think I should put this in a separate commit, or is it ok as it is?

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 19, 2020
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 19, 2020
Fixes tektoncd#405

Issue tektoncd#356 found a bug in Triggers v0.1.0 (fixed in v0.2.0) where the
admission webhook times out after adding around 35 Triggers to an
EventListener.

This PR adds a regression test where we create an EventListener with
1000 Triggers.

Also, moves the cluster-scope resource cleanup code (from
tektoncd@7ba80a7)
out of init_test.go and into eventlistener_test.go.
@ncskier ncskier marked this pull request as ready for review February 19, 2020 21:01
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 19, 2020
@@ -117,6 +117,13 @@ be used to run only [the unit tests](#unit-tests), i.e.:
// +build e2e
```

#### Cleaning up cluster-scoped resources

Each integration test runs in its own Namespace; each Namespace is torn down
Copy link
Member

Choose a reason for hiding this comment

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

👍

}

// Verify that the EventListener was created properly
if err := WaitFor(eventListenerReady(t, c, namespace, el.Name)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to verify that the EL actually contains the 1000 triggers?

Copy link
Member

Choose a reason for hiding this comment

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

Or perhaps that the sink got created?

Copy link
Member Author

@ncskier ncskier Feb 20, 2020

Choose a reason for hiding this comment

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

This should verify that the sink got created, right? Because it waits for the sink Pod to be ready.

As for verifying that the EventListener actually contains the 1000 Triggers... I guess we could trigger an event to fire all of the Triggers (maybe create a TaskRun or something?). I don't know if this would stress out our test cluster though 😅

Or do you mean just checking the length of the Triggers array in the EventListener returned after creation?

Copy link
Member

Choose a reason for hiding this comment

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

ahh you are right...I did not notice that it actually waits for the sink to be created

Copy link
Member Author

@ncskier ncskier Feb 20, 2020

Choose a reason for hiding this comment

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

What about verifying the 1000 Triggers? Do you think it's alright without that? (I assume yes, since you merged the PR 😄)

Copy link
Member

Choose a reason for hiding this comment

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

Yes, we have other tests that verify that we support multiple triggers

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 20, 2020
@dibyom
Copy link
Member

dibyom commented Feb 20, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 20, 2020
@tekton-robot tekton-robot merged commit fe097d1 into tektoncd:master Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression test for multiple triggers admission webhook timeout
4 participants