e2e: use Ginkgo context
All code must use the context from Ginkgo when doing API calls or polling for a change, otherwise the code would not return immediately when the test gets aborted.
This commit is contained in:
@@ -43,8 +43,8 @@ func parseAPIServerMetrics(data string) (APIServerMetrics, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (g *Grabber) getMetricsFromAPIServer() (string, error) {
|
||||
rawOutput, err := g.client.CoreV1().RESTClient().Get().RequestURI("/metrics").Do(context.TODO()).Raw()
|
||||
func (g *Grabber) getMetricsFromAPIServer(ctx context.Context) (string, error) {
|
||||
rawOutput, err := g.client.CoreV1().RESTClient().Get().RequestURI("/metrics").Do(ctx).Raw()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user