-
Notifications
You must be signed in to change notification settings - Fork 420
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// +build e2e | ||
|
||
/* | ||
Copyright 2019 The Tekton Authors | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package test | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
|
||
bldr "github.com/tektoncd/triggers/test/builder" | ||
knativetest "knative.dev/pkg/test" | ||
) | ||
|
||
/* | ||
* Test creating an EventListener with a large number of Triggers. | ||
* This is a regression test for issue #356. | ||
*/ | ||
func TestEventListenerScale(t *testing.T) { | ||
c, namespace := setup(t) | ||
t.Parallel() | ||
|
||
defer tearDown(t, c, namespace) | ||
knativetest.CleanupOnInterrupt(func() { tearDown(t, c, namespace) }, t.Logf) | ||
|
||
t.Log("Start EventListener Scale e2e test") | ||
|
||
// Create an EventListener with 1000 Triggers | ||
var err error | ||
el := bldr.EventListener("my-eventlistener", namespace) | ||
for i := 0; i < 1000; i++ { | ||
trigger := bldr.Trigger("my-triggertemplate", "v1alpha1", | ||
bldr.EventListenerTriggerBinding("my-triggerbinding", "", "v1alpha1"), | ||
) | ||
trigger.Name = fmt.Sprintf("%d", i) | ||
el.Spec.Triggers = append(el.Spec.Triggers, trigger) | ||
} | ||
el, err = c.TriggersClient.TektonV1alpha1().EventListeners(namespace).Create(el) | ||
if err != nil { | ||
t.Fatalf("Error creating EventListener: %s", err) | ||
} | ||
|
||
// Verify that the EventListener was created properly | ||
if err := WaitFor(eventListenerReady(t, c, namespace, el.Name)); err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or perhaps that the sink got created? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 😄) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we have other tests that verify that we support multiple triggers |
||
t.Fatalf("EventListener is not ready: %s", err) | ||
} | ||
t.Log("EventListener is ready") | ||
} |
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.
👍