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 <torinsandall@gmail.com>
This commit is contained in:
Torin Sandall
2020-09-25 12:09:53 -04:00
committed by Patrick East
parent e9aee648b9
commit e17c79e0f9
-3
View File
@@ -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.")
}