Skip to content

Commit 7ac27d5

Browse files
committed
speedup tests
1 parent 6e1e211 commit 7ac27d5

File tree

3 files changed

+42
-14
lines changed

3 files changed

+42
-14
lines changed

sns/pubsub_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import (
2323
)
2424

2525
func TestPublishSubscribe(t *testing.T) {
26+
t.Parallel()
27+
2628
tests.TestPubSub(
2729
t,
2830
tests.Features{
@@ -37,6 +39,8 @@ func TestPublishSubscribe(t *testing.T) {
3739
}
3840

3941
func TestPubSub_arn_topic_resolver(t *testing.T) {
42+
t.Parallel()
43+
4044
tests.TestPublishSubscribe(
4145
t,
4246
tests.TestContext{
@@ -90,6 +94,8 @@ func TestPubSub_arn_topic_resolver(t *testing.T) {
9094
}
9195

9296
func TestPublisher_CreateTopic_is_idempotent(t *testing.T) {
97+
t.Parallel()
98+
9399
pub, _ := createPubSub(t)
94100

95101
topicName := watermill.NewUUID()
@@ -104,6 +110,8 @@ func TestPublisher_CreateTopic_is_idempotent(t *testing.T) {
104110
}
105111

106112
func TestSubscriber_SubscribeInitialize_is_idempotent(t *testing.T) {
113+
t.Parallel()
114+
107115
_, sub := createPubSub(t)
108116

109117
topicName := watermill.NewUUID()

sqs/pubsub_stress_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//go:build stress
2+
// +build stress
3+
4+
package sqs
5+
6+
func TestPubSub_stress(t *testing.T) {
7+
tests.TestPubSubStressTest(
8+
t,
9+
tests.Features{
10+
ConsumerGroups: false,
11+
ExactlyOnceDelivery: false,
12+
GuaranteedOrder: true,
13+
Persistent: true,
14+
},
15+
createPubSub,
16+
createPubSubWithConsumerGroup,
17+
)
18+
}

sqs/pubsub_test.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,9 @@ import (
2121
)
2222

2323
func TestPubSub(t *testing.T) {
24-
tests.TestPubSub(
25-
t,
26-
tests.Features{
27-
ConsumerGroups: false,
28-
ExactlyOnceDelivery: false,
29-
GuaranteedOrder: true,
30-
Persistent: true,
31-
},
32-
createPubSub,
33-
createPubSubWithConsumerGroup,
34-
)
35-
}
24+
t.Parallel()
3625

37-
func TestPubSub_stress(t *testing.T) {
38-
tests.TestPubSubStressTest(
26+
tests.TestPubSub(
3927
t,
4028
tests.Features{
4129
ConsumerGroups: false,
@@ -49,6 +37,8 @@ func TestPubSub_stress(t *testing.T) {
4937
}
5038

5139
func TestPublishSubscribe_with_GenerateQueueUrlResolver(t *testing.T) {
40+
t.Parallel()
41+
5242
tests.TestPublishSubscribe(
5343
t,
5444
tests.TestContext{
@@ -112,6 +102,8 @@ func TestPublishSubscribe_with_GenerateQueueUrlResolver(t *testing.T) {
112102
}
113103

114104
func TestPublishSubscribe_with_TransparentUrlResolver(t *testing.T) {
105+
t.Parallel()
106+
115107
tests.TestPublishSubscribe(
116108
t,
117109
tests.TestContext{
@@ -175,6 +167,8 @@ func TestPublishSubscribe_with_TransparentUrlResolver(t *testing.T) {
175167
}
176168

177169
func TestPublishSubscribe_batching(t *testing.T) {
170+
t.Parallel()
171+
178172
tests.TestPublishSubscribe(
179173
t,
180174
tests.TestContext{
@@ -231,6 +225,8 @@ func TestPublishSubscribe_batching(t *testing.T) {
231225
}
232226

233227
func TestPublishSubscribe_creating_queue_with_different_settings_should_be_idempotent(t *testing.T) {
228+
t.Parallel()
229+
234230
logger := watermill.NewStdLogger(false, false)
235231

236232
sub1, err := sqs.NewSubscriber(sqs.SubscriberConfig{
@@ -264,6 +260,8 @@ func TestPublishSubscribe_creating_queue_with_different_settings_should_be_idemp
264260
}
265261

266262
func TestPublisher_GetOrCreateQueueUrl_is_idempotent(t *testing.T) {
263+
t.Parallel()
264+
267265
pub, _ := createPubSub(t)
268266

269267
topicName := watermill.NewUUID()
@@ -280,6 +278,8 @@ func TestPublisher_GetOrCreateQueueUrl_is_idempotent(t *testing.T) {
280278
}
281279

282280
func TestSubscriber_doesnt_hang_when_queue_doesnt_exist(t *testing.T) {
281+
t.Parallel()
282+
283283
cfg := newAwsConfig(t)
284284

285285
_, sub := createPubSubWithConfig(
@@ -315,6 +315,8 @@ func TestSubscriber_doesnt_hang_when_queue_doesnt_exist(t *testing.T) {
315315
}
316316

317317
func TestPublisher_do_not_create_queue(t *testing.T) {
318+
t.Parallel()
319+
318320
cfg := newAwsConfig(t)
319321

320322
pub, _ := createPubSubWithConfig(

0 commit comments

Comments
 (0)