Skip to content

Commit 1ef10b8

Browse files
Use more routes and expect the stress test to hit the hard cap
Each router should cap at 10 conflicts. Use more routes to get more potentially conflicting writes.
1 parent 617e2c2 commit 1ef10b8

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pkg/router/controller/router_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (c *RouterController) Commit() {
234234

235235
// processRoute logs and propagates a route event to the plugin
236236
func (c *RouterController) processRoute(eventType watch.EventType, route *routeapi.Route) {
237-
glog.V(4).Infof("Processing Route: %s/%s -> %s", route.Namespace, route.Name, route.Spec.To.Name)
237+
glog.V(4).Infof("Processing route: %s/%s -> %s %s", route.Namespace, route.Name, route.Spec.To.Name, route.UID)
238238
glog.V(4).Infof(" Alias: %s", route.Spec.Host)
239239
if len(route.Spec.Path) > 0 {
240240
glog.V(4).Infof(" Path: %s", route.Spec.Path)

pkg/router/controller/status.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ type SimpleContentionTracker struct {
313313
func NewSimpleContentionTracker(interval time.Duration) *SimpleContentionTracker {
314314
return &SimpleContentionTracker{
315315
expires: interval,
316-
maxContentions: 10,
316+
maxContentions: 5,
317317

318318
ids: make(map[string]trackerElement),
319319
}

test/extended/router/stress.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
189189
g.By("creating multiple routes")
190190
client := routeclientset.NewForConfigOrDie(oc.AdminConfig()).Route().Routes(ns)
191191
var rv string
192-
for i := 0; i < 10; i++ {
192+
for i := 0; i < 20; i++ {
193193
_, err := client.Create(&routev1.Route{
194194
ObjectMeta: metav1.ObjectMeta{
195195
Name: fmt.Sprintf("%d", i),
@@ -210,7 +210,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
210210
if err != nil {
211211
return false, err
212212
}
213-
o.Expect(routes.Items).To(o.HaveLen(10))
213+
o.Expect(routes.Items).To(o.HaveLen(20))
214214
other := 0
215215
conflicting := 0
216216
for _, route := range routes.Items {
@@ -233,7 +233,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
233233
}
234234
// if other routers are writing status, wait until we get a complete
235235
// set since we don't have a way to tell other routers to ignore us
236-
if conflicting < 3 && other%10 != 0 {
236+
if conflicting < 3 && other%20 != 0 {
237237
return false, nil
238238
}
239239
outputIngress(routes.Items...)
@@ -248,7 +248,7 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
248248
o.Expect(err).NotTo(o.HaveOccurred())
249249
func() {
250250
defer w.Stop()
251-
timer := time.NewTimer(10 * time.Second)
251+
timer := time.NewTimer(15 * time.Second)
252252
ch := w.ResultChan()
253253
Wait:
254254
for i := 0; ; i++ {
@@ -260,7 +260,8 @@ var _ = g.Describe("[Conformance][Area:Networking][Feature:Router]", func() {
260260
break Wait
261261
}
262262
}
263-
o.Expect(writes).To(o.BeNumerically("<", 10))
263+
// we expect to see no more than 10 writes per router (we should hit the hard limit)
264+
o.Expect(writes).To(o.BeNumerically("<", 30))
264265
}()
265266

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

0 commit comments

Comments
 (0)