From e17c79e0f930eaaccb60e7b6942e0b789ec24b29 Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Fri, 25 Sep 2020 12:09:53 -0400 Subject: [PATCH] runtime: Fix data race in runtime package test The runtime tests for the telemetry reporting feature contained a data race because they were setting the version.Version variable which is read by the runtime in other test cases. Since we now have the version.Version value set in the source code, we do not have to overwrite it in the test implementation. Signed-off-by: Torin Sandall --- runtime/runtime_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index a05aaeab62..a3050af11d 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -27,7 +27,6 @@ import ( "github.com/open-policy-agent/opa/storage" "github.com/open-policy-agent/opa/util" "github.com/open-policy-agent/opa/util/test" - "github.com/open-policy-agent/opa/version" ) func TestWatchPaths(t *testing.T) { @@ -275,7 +274,6 @@ func TestCheckOPAUpdateLoopNoUpdate(t *testing.T) { baseURL, teardown := getTestServer(exp, http.StatusOK) defer teardown() - version.Version = "v0.20.0" testCheckOPAUpdateLoop(t, baseURL, "OPA is up to date.") } @@ -291,7 +289,6 @@ func TestCheckOPAUpdateLoopWithNewUpdate(t *testing.T) { baseURL, teardown := getTestServer(exp, http.StatusOK) defer teardown() - version.Version = "v0.20.0" testCheckOPAUpdateLoop(t, baseURL, "OPA is out of date.") }