Skip to content

Commit c6591aa

Browse files
committed
make more tests parallel
1 parent b1e41f5 commit c6591aa

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

pkg/billing/workflow_client_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func (s *testWorkflowServer) CheckAggregationStatus(ctx context.Context, req *pb
6363
// ---------- Test GRPC Dial with TLS Credentials ----------
6464

6565
func TestIntegration_GRPCWithCerts(t *testing.T) {
66+
t.Parallel()
6667
// Paths to self-signed certificate and key fixtures.
6768
serverCertPath := "./test-fixtures/domain_test.pem"
6869
serverKeyPath := "./test-fixtures/domain_test.key"
@@ -130,6 +131,7 @@ func TestIntegration_GRPCWithCerts(t *testing.T) {
130131
}
131132

132133
func TestIntegration_GRPC_Insecure(t *testing.T) {
134+
t.Parallel()
133135
// Paths to self-signed certificate and key fixtures.
134136
serverCertPath := "./test-fixtures/domain_test.pem"
135137
serverKeyPath := "./test-fixtures/domain_test.key"
@@ -170,6 +172,7 @@ func TestIntegration_GRPC_Insecure(t *testing.T) {
170172

171173
// Test that NewWorkflowClient fails when given an invalid address.
172174
func TestNewWorkflowClient_InvalidAddress(t *testing.T) {
175+
t.Parallel()
173176
lggr := logger.Test(t)
174177
wc, err := NewWorkflowClient(lggr, "invalid-address",
175178
WithWorkflowTransportCredentials(insecure.NewCredentials()),
@@ -186,6 +189,7 @@ func TestNewWorkflowClient_InvalidAddress(t *testing.T) {
186189

187190
// Test that calling Close() twice does not cause a panic.
188191
func TestWorkflowClient_CloseTwice(t *testing.T) {
192+
t.Parallel()
189193
lis, err := net.Listen("tcp", "localhost:0")
190194
require.NoError(t, err)
191195
grpcServer := grpc.NewServer()
@@ -212,6 +216,7 @@ func TestWorkflowClient_CloseTwice(t *testing.T) {
212216

213217
// Additional test: Verify that dialGrpc fails if an unreachable address is provided.
214218
func TestWorkflowClient_DialUnreachable(t *testing.T) {
219+
t.Parallel()
215220
lggr := logger.Test(t)
216221
unreachableAddr := "192.0.2.1:12345" // Reserved for documentation.
217222
wc, err := NewWorkflowClient(lggr, unreachableAddr,
@@ -230,6 +235,7 @@ func TestWorkflowClient_DialUnreachable(t *testing.T) {
230235
// ---------- Test JWT Token Creation ----------
231236

232237
func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) {
238+
t.Parallel()
233239

234240
mockJWT := mocks.NewJWTGenerator(t)
235241
req := MockRequest{Field: "test request"}
@@ -258,6 +264,7 @@ func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) {
258264

259265
// Test that client handles the case when no JWT manager is provided.
260266
func TestWorkflowClient_NoSigningKey(t *testing.T) {
267+
t.Parallel()
261268
ctx := context.Background()
262269
req := MockRequest{Field: "test"}
263270
wc := &workflowClient{
@@ -273,6 +280,7 @@ func TestWorkflowClient_NoSigningKey(t *testing.T) {
273280

274281
// Test that client handles JWT manager errors properly
275282
func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) {
283+
t.Parallel()
276284
mockJWT := mocks.NewJWTGenerator(t)
277285
req := MockRequest{Field: "test"}
278286

@@ -290,6 +298,7 @@ func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) {
290298
}
291299

292300
func TestWorkflowClient_RepeatedSign(t *testing.T) {
301+
t.Parallel()
293302
mockJWT := mocks.NewJWTGenerator(t)
294303
req := MockRequest{Field: "repeatable"}
295304
expectedToken := "consistent.jwt.token"

pkg/loop/reportingplugins/grpc_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func newStopCh(t *testing.T) <-chan struct{} {
3232

3333
func PluginGenericTest(t *testing.T, p core.ReportingPluginClient) {
3434
t.Run("PluginServer", func(t *testing.T) {
35+
t.Parallel()
3536
ctx := t.Context()
3637
factory, err := p.NewReportingPluginFactory(ctx,
3738
core.ReportingPluginServiceConfig{},
@@ -48,6 +49,7 @@ func PluginGenericTest(t *testing.T, p core.ReportingPluginClient) {
4849
reportingplugintest.RunFactory(t, factory)
4950
})
5051
t.Run("ValidationService", func(t *testing.T) {
52+
t.Parallel()
5153
ctx := t.Context()
5254
validationService, err := p.NewValidationService(ctx)
5355
require.NoError(t, err)

pkg/storage/workflow_client_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package storage
33
import (
44
"context"
55
"fmt"
6-
"google.golang.org/protobuf/types/known/timestamppb"
76
"net"
87
"os"
98
"testing"
109
"time"
1110

11+
"google.golang.org/protobuf/types/known/timestamppb"
12+
1213
"github.com/stretchr/testify/assert"
1314
"github.com/stretchr/testify/require"
1415
"google.golang.org/grpc"
@@ -49,6 +50,7 @@ func (s *testWorkflowServer) DownloadArtifact(ctx context.Context, req *pb.Downl
4950
// ---------- Test GRPC Dial with TLS Credentials ----------
5051

5152
func TestIntegration_GRPCWithCerts(t *testing.T) {
53+
t.Parallel()
5254
// Paths to self-signed certificate and key fixtures.
5355
serverCertPath := "./test-fixtures/domain_test.pem"
5456
serverKeyPath := "./test-fixtures/domain_test.key"
@@ -120,6 +122,7 @@ func TestIntegration_GRPCWithCerts(t *testing.T) {
120122
}
121123

122124
func TestIntegration_GRPC_Insecure(t *testing.T) {
125+
t.Parallel()
123126
// Start a test gRPC server without TLS.
124127
lis, err := net.Listen("tcp", "localhost:0")
125128
require.NoError(t, err)
@@ -166,6 +169,7 @@ func TestIntegration_GRPC_Insecure(t *testing.T) {
166169
}
167170

168171
func TestNewWorkflowClient_InvalidAddress(t *testing.T) {
172+
t.Parallel()
169173
lggr := logger.Test(t)
170174
wc, err := NewWorkflowClient(lggr, "invalid-address",
171175
WithWorkflowTransportCredentials(insecure.NewCredentials()),
@@ -186,6 +190,7 @@ func TestNewWorkflowClient_InvalidAddress(t *testing.T) {
186190
}
187191

188192
func TestWorkflowClient_CloseTwice(t *testing.T) {
193+
t.Parallel()
189194
lis, err := net.Listen("tcp", "localhost:0")
190195
require.NoError(t, err)
191196
grpcServer := grpc.NewServer()
@@ -211,6 +216,7 @@ func TestWorkflowClient_CloseTwice(t *testing.T) {
211216
}
212217

213218
func TestWorkflowClient_DialUnreachable(t *testing.T) {
219+
t.Parallel()
214220
lggr := logger.Test(t)
215221
unreachableAddr := "192.0.2.1:12345" // Reserved for documentation.
216222
wc, err := NewWorkflowClient(lggr, unreachableAddr,
@@ -234,6 +240,7 @@ func TestWorkflowClient_DialUnreachable(t *testing.T) {
234240
// ---------- Test JWT Token Creation ----------
235241

236242
func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) {
243+
t.Parallel()
237244

238245
mockJWT := mocks.NewJWTGenerator(t)
239246
req := MockRequest{Field: "test request"}
@@ -262,6 +269,7 @@ func TestWorkflowClient_AddJWTAuthToContext(t *testing.T) {
262269

263270
// Test that client handles the case when no JWT manager is provided.
264271
func TestWorkflowClient_NoSigningKey(t *testing.T) {
272+
t.Parallel()
265273
ctx := context.Background()
266274
req := MockRequest{Field: "test"}
267275
wc := &workflowClient{
@@ -277,6 +285,7 @@ func TestWorkflowClient_NoSigningKey(t *testing.T) {
277285

278286
// Test that client handles JWT manager errors properly
279287
func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) {
288+
t.Parallel()
280289
mockJWT := mocks.NewJWTGenerator(t)
281290
req := MockRequest{Field: "test"}
282291

@@ -294,6 +303,7 @@ func TestWorkflowClient_VerifySignature_Invalid(t *testing.T) {
294303
}
295304

296305
func TestWorkflowClient_RepeatedSign(t *testing.T) {
306+
t.Parallel()
297307
mockJWT := mocks.NewJWTGenerator(t)
298308
req := MockRequest{Field: "repeatable"}
299309
expectedToken := "consistent.jwt.token"

0 commit comments

Comments
 (0)