From 9c8b0b451f7a936d732d6bf3d022b9c49c7619bb Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 10 May 2021 13:30:10 -0400 Subject: [PATCH] testing: don't run t.Parallel in a goroutine TestACLEndpoint_Login_with_TokenLocality was reguardly being reported as failed even though it was not failing. I took another look and I suspect it is because t.Parllel was being called in a goroutine. This would lead to strange behaviour which apparently confused the 'go test' runner. --- agent/consul/acl_endpoint_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agent/consul/acl_endpoint_test.go b/agent/consul/acl_endpoint_test.go index cf536b0c4c..0031ce6211 100644 --- a/agent/consul/acl_endpoint_test.go +++ b/agent/consul/acl_endpoint_test.go @@ -10,6 +10,11 @@ import ( "testing" "time" + uuid "github.com/hashicorp/go-uuid" + msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" + "github.com/stretchr/testify/require" + "gopkg.in/square/go-jose.v2/jwt" + "github.com/hashicorp/consul/acl" "github.com/hashicorp/consul/agent/consul/authmethod/kubeauth" "github.com/hashicorp/consul/agent/consul/authmethod/testauth" @@ -18,10 +23,6 @@ import ( "github.com/hashicorp/consul/sdk/freeport" "github.com/hashicorp/consul/sdk/testutil" "github.com/hashicorp/consul/sdk/testutil/retry" - uuid "github.com/hashicorp/go-uuid" - msgpackrpc "github.com/hashicorp/net-rpc-msgpackrpc" - "github.com/stretchr/testify/require" - "gopkg.in/square/go-jose.v2/jwt" ) func TestACLEndpoint_Bootstrap(t *testing.T) { @@ -4981,7 +4982,7 @@ func TestACLEndpoint_Login_with_TokenLocality(t *testing.T) { t.Skip("too slow for testing.Short") } - go t.Parallel() + t.Parallel() _, s1, codec := testACLServerWithConfig(t, func(c *Config) { c.ACLTokenMinExpirationTTL = 10 * time.Millisecond