Skip to content

Commit

Permalink
Use more routes and expect the stress test to hit the hard cap
Browse files Browse the repository at this point in the history
Each router should cap at 10 conflicts. Use more routes to get more
potentially conflicting writes.
  • Loading branch information
smarterclayton committed May 14, 2018
1 parent 617e2c2 commit df50150
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/router/controller/router_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (c *RouterController) Commit() {

// processRoute logs and propagates a route event to the plugin
func (c *RouterController) processRoute(eventType watch.EventType, route *routeapi.Route) {
glog.V(4).Infof("Processing Route: %s/%s -> %s", route.Namespace, route.Name, route.Spec.To.Name)
glog.V(4).Infof("Processing route: %s/%s -> %s %s", route.Namespace, route.Name, route.Spec.To.Name, route.UID)
glog.V(4).Infof(" Alias: %s", route.Spec.Host)
if len(route.Spec.Path) > 0 {
glog.V(4).Infof(" Path: %s", route.Spec.Path)
Expand Down
7 changes: 4 additions & 3 deletions test/extended/router/stress.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
g.By("creating multiple routes")
client := routeclientset.NewForConfigOrDie(oc.AdminConfig()).Route().Routes(ns)
var rv string
for i := 0; i < 10; i++ {
for i := 0; i < 20; i++ {
_, err := client.Create(&routev1.Route{
ObjectMeta: metav1.ObjectMeta{
Name: fmt.Sprintf("%d", i),
Expand Down Expand Up @@ -248,7 +248,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
o.Expect(err).NotTo(o.HaveOccurred())
func() {
defer w.Stop()
timer := time.NewTimer(10 * time.Second)
timer := time.NewTimer(15 * time.Second)
ch := w.ResultChan()
Wait:
for i := 0; ; i++ {
Expand All @@ -260,7 +260,8 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
break Wait
}
}
o.Expect(writes).To(o.BeNumerically("<", 10))
// we expect to see no more than 10 writes per router (we should hit the hard limit)
o.Expect(writes).To(o.BeNumerically("<", 30))
}()

// the os_http_be.map file will vary, so only check the haproxy config
Expand Down

0 comments on commit df50150

Please sign in to comment.