mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-25 01:35:18 -06:00
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:
committed by
Patrick East
parent
e9aee648b9
commit
e17c79e0f9
@@ -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.")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user