Skip to content

Commit 33a4243

Browse files
Expand extended runtime tests to check for gorutine usage (#4388)
* add test for goroutine leaks * change time * try to get it working on windows * still tinkering with windows
1 parent 5b3e1f1 commit 33a4243

File tree

2 files changed

+228
-100
lines changed

2 files changed

+228
-100
lines changed

pkg/testing/tools/slope.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ import (
1313
// Slope is a slim wrapper around a regression library for calculating rate of change over time in tests.
1414
type Slope struct {
1515
handler *regression.Regression
16+
label string
1617
}
1718

1819
func NewSlope(label string) Slope {
1920
handler := new(regression.Regression)
2021
handler.SetObserved(label)
2122
handler.SetVar(0, "time")
22-
return Slope{handler: handler}
23+
return Slope{handler: handler, label: label}
2324
}
2425

2526
// add a datapoint and timestamp to the calculaton.
@@ -46,3 +47,7 @@ func (slope Slope) Formula() string {
4647
func (slope Slope) Debug() string {
4748
return slope.handler.String()
4849
}
50+
51+
func (slope Slope) Name() string {
52+
return slope.label
53+
}

0 commit comments

Comments
 (0)