diff --git a/pkg/billing/workflow_client_test.go b/pkg/billing/workflow_client_test.go index 41ce002d6e..b71a57442e 100644 --- a/pkg/billing/workflow_client_test.go +++ b/pkg/billing/workflow_client_test.go @@ -63,6 +63,7 @@ func (s *testWorkflowServer) CheckAggregationStatus(ctx context.Context, req *pb // ---------- Test GRPC Dial with TLS Credentials ---------- func TestIntegration_GRPCWithCerts(t *testing.T) { + t.Parallel() // Paths to self-signed certificate and key fixtures. serverCertPath := "./test-fixtures/domain_test.pem" serverKeyPath := "./test-fixtures/domain_test.key" @@ -130,6 +131,7 @@ func TestIntegration_GRPCWithCerts(t *testing.T) { } func TestIntegration_GRPC_Insecure(t *testing.T) { + t.Parallel() // Paths to self-signed certificate and key fixtures. serverCertPath := "./test-fixtures/domain_test.pem" serverKeyPath := "./test-fixtures/domain_test.key" @@ -170,6 +172,7 @@ func TestIntegration_GRPC_Insecure(t *testing.T) { // Test that NewWorkflowClient fails when given an invalid address. func TestNewWorkflowClient_InvalidAddress(t *testing.T) { + t.Parallel() lggr := logger.Test(t) wc, err := NewWorkflowClient(lggr, "invalid-address", WithWorkflowTransportCredentials(insecure.NewCredentials()), @@ -186,6 +189,7 @@ func TestNewWorkflowClient_InvalidAddress(t *testing.T) { // Test that calling Close() twice does not cause a panic. func TestWorkflowClient_CloseTwice(t *testing.T) { + t.Parallel() lis, err := net.Listen("tcp", "localhost:0") require.NoError(t, err) grpcServer := grpc.NewServer() @@ -212,6 +216,7 @@ func TestWorkflowClient_CloseTwice(t *testing.T) { // Additional test: Verify that dialGrpc fails if an unreachable address is provided. func TestWorkflowClient_DialUnreachable(t *testing.T) { + t.Parallel() lggr := logger.Test(t) unreachableAddr := "192.0.2.1:12345" // Reserved for documentation. wc, err := NewWorkflowClient(lggr, unreachableAddr, @@ -230,6 +235,7 @@ func TestWorkflowClient_DialUnreachable(t *testing.T) { // ---------- Test JWT Token Creation ---------- func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) { + t.Parallel() mockJWT := mocks.NewJWTGenerator(t) req := MockRequest{Field: "test request"} @@ -258,6 +264,7 @@ func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) { // Test that client handles the case when no JWT manager is provided. func TestWorkflowClient_NoSigningKey(t *testing.T) { + t.Parallel() ctx := context.Background() req := MockRequest{Field: "test"} wc := &workflowClient{ @@ -273,6 +280,7 @@ func TestWorkflowClient_NoSigningKey(t *testing.T) { // Test that client handles JWT manager errors properly func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) { + t.Parallel() mockJWT := mocks.NewJWTGenerator(t) req := MockRequest{Field: "test"} @@ -290,6 +298,7 @@ func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) { } func TestWorkflowClient_RepeatedSign(t *testing.T) { + t.Parallel() mockJWT := mocks.NewJWTGenerator(t) req := MockRequest{Field: "repeatable"} expectedToken := "consistent.jwt.token" diff --git a/pkg/loop/logger_loop_test.go b/pkg/loop/logger_loop_test.go index f1eb41866e..3501273686 100644 --- a/pkg/loop/logger_loop_test.go +++ b/pkg/loop/logger_loop_test.go @@ -14,6 +14,7 @@ import ( ) func TestHCLogLoggerPanic(t *testing.T) { + t.Parallel() type testCase struct { level int expectedMessage string diff --git a/pkg/storage/workflow_client_test.go b/pkg/storage/workflow_client_test.go index 3b917101b3..a9f3bfabea 100644 --- a/pkg/storage/workflow_client_test.go +++ b/pkg/storage/workflow_client_test.go @@ -3,12 +3,13 @@ package storage import ( "context" "fmt" - "google.golang.org/protobuf/types/known/timestamppb" "net" "os" "testing" "time" + "google.golang.org/protobuf/types/known/timestamppb" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "google.golang.org/grpc" @@ -49,6 +50,7 @@ func (s *testWorkflowServer) DownloadArtifact(ctx context.Context, req *pb.Downl // ---------- Test GRPC Dial with TLS Credentials ---------- func TestIntegration_GRPCWithCerts(t *testing.T) { + t.Parallel() // Paths to self-signed certificate and key fixtures. serverCertPath := "./test-fixtures/domain_test.pem" serverKeyPath := "./test-fixtures/domain_test.key" @@ -120,6 +122,7 @@ func TestIntegration_GRPCWithCerts(t *testing.T) { } func TestIntegration_GRPC_Insecure(t *testing.T) { + t.Parallel() // Start a test gRPC server without TLS. lis, err := net.Listen("tcp", "localhost:0") require.NoError(t, err) @@ -166,6 +169,7 @@ func TestIntegration_GRPC_Insecure(t *testing.T) { } func TestNewWorkflowClient_InvalidAddress(t *testing.T) { + t.Parallel() lggr := logger.Test(t) wc, err := NewWorkflowClient(lggr, "invalid-address", WithWorkflowTransportCredentials(insecure.NewCredentials()), @@ -186,6 +190,7 @@ func TestNewWorkflowClient_InvalidAddress(t *testing.T) { } func TestWorkflowClient_CloseTwice(t *testing.T) { + t.Parallel() lis, err := net.Listen("tcp", "localhost:0") require.NoError(t, err) grpcServer := grpc.NewServer() @@ -211,6 +216,7 @@ func TestWorkflowClient_CloseTwice(t *testing.T) { } func TestWorkflowClient_DialUnreachable(t *testing.T) { + t.Parallel() lggr := logger.Test(t) unreachableAddr := "192.0.2.1:12345" // Reserved for documentation. wc, err := NewWorkflowClient(lggr, unreachableAddr, @@ -234,6 +240,7 @@ func TestWorkflowClient_DialUnreachable(t *testing.T) { // ---------- Test JWT Token Creation ---------- func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) { + t.Parallel() mockJWT := mocks.NewJWTGenerator(t) req := MockRequest{Field: "test request"} @@ -262,6 +269,7 @@ func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) { // Test that client handles the case when no JWT manager is provided. func TestWorkflowClient_NoSigningKey(t *testing.T) { + t.Parallel() ctx := context.Background() req := MockRequest{Field: "test"} wc := &workflowClient{ @@ -277,6 +285,7 @@ func TestWorkflowClient_NoSigningKey(t *testing.T) { // Test that client handles JWT manager errors properly func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) { + t.Parallel() mockJWT := mocks.NewJWTGenerator(t) req := MockRequest{Field: "test"} @@ -294,6 +303,7 @@ func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) { } func TestWorkflowClient_RepeatedSign(t *testing.T) { + t.Parallel() mockJWT := mocks.NewJWTGenerator(t) req := MockRequest{Field: "repeatable"} expectedToken := "consistent.jwt.token"