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 1ef10b8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 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
2 changes: 1 addition & 1 deletion pkg/router/controller/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ type SimpleContentionTracker struct {
func NewSimpleContentionTracker(interval time.Duration) *SimpleContentionTracker {
return &SimpleContentionTracker{
expires: interval,
maxContentions: 10,
maxContentions: 5,

ids: make(map[string]trackerElement),
}
Expand Down
11 changes: 6 additions & 5 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 All @@ -210,7 +210,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
if err != nil {
return false, err
}
o.Expect(routes.Items).To(o.HaveLen(10))
o.Expect(routes.Items).To(o.HaveLen(20))
other := 0
conflicting := 0
for _, route := range routes.Items {
Expand All @@ -233,7 +233,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
}
// if other routers are writing status, wait until we get a complete
// set since we don't have a way to tell other routers to ignore us
if conflicting < 3 && other%10 != 0 {
if conflicting < 3 && other%20 != 0 {
return false, nil
}
outputIngress(routes.Items...)
Expand All @@ -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 1ef10b8

Please sign in to comment.