summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/limit/service_test.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/service/limit/service_test.go b/service/limit/service_test.go
index c21d0419..6285f213 100644
--- a/service/limit/service_test.go
+++ b/service/limit/service_test.go
@@ -391,6 +391,10 @@ func Test_Service_Listener_MaxMemoryUsage(t *testing.T) {
}
}
func getPID(s interface{}) string {
- w := s.(*rrhttp.Service).Server().Workers()[0]
- return fmt.Sprintf("%v", *w.Pid)
+ if len(s.(*rrhttp.Service).Server().Workers()) > 0 {
+ w := s.(*rrhttp.Service).Server().Workers()[0]
+ return fmt.Sprintf("%v", *w.Pid)
+ } else {
+ panic("no workers")
+ }
}