From b6650a55cdddd88a300d66237ab4751215738341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Fri, 1 Nov 2019 12:33:43 +0100 Subject: [PATCH] test(core): disable parallel TestMetricsEmission on Windows Not a fan of this bandaid, but maybe it resolves the AppVeyor-exclusive failures. See https://github.com/loadimpact/k6/pull/1203#discussion_r341513463 --- core/engine_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/engine_test.go b/core/engine_test.go index 05898da29199..b92db849d0b5 100644 --- a/core/engine_test.go +++ b/core/engine_test.go @@ -24,6 +24,7 @@ import ( "context" "fmt" "net/url" + "runtime" "testing" "time" @@ -44,6 +45,8 @@ import ( "github.com/loadimpact/k6/stats/dummy" ) +const isWindows = runtime.GOOS == "windows" + // Apply a null logger to the engine and return the hook. func applyNullLogger(e *Engine) *logtest.Hook { logger, hook := logtest.NewNullLogger() @@ -915,7 +918,9 @@ func TestEmittedMetricsWhenScalingDown(t *testing.T) { } func TestMetricsEmission(t *testing.T) { - t.Parallel() + if !isWindows { + t.Parallel() + } testCases := []struct { method string @@ -938,7 +943,9 @@ func TestMetricsEmission(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.method, func(t *testing.T) { - t.Parallel() + if !isWindows { + t.Parallel() + } runner, err := js.New( &loader.SourceData{URL: &url.URL{Path: "/script.js"}, Data: []byte(fmt.Sprintf(` import { sleep } from "k6";