Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable race detector in tests, fix data races #135

Merged
merged 1 commit into from
Jan 27, 2023
Merged

Conversation

vearutop
Copy link
Contributor

@vearutop vearutop commented Jan 25, 2023

This PR:

  • enables -race in tests,
  • adds sync accessors to test helpers fields,
  • deprecates direct access to those fields.

@github-actions
Copy link

Lines Of Code

Language Files Lines Code Comments Blanks Complexity Bytes
Go 28 2827 (+45) 2083 (+30) 265 (+4) 479 (+11) 379 (+4) 73.7K (+917B)
Go (test) 6 1334 1077 41 216 81 38.1K (-197B)
YAML 4 364 310 16 38 0 13.3K (+6B)

@github-actions
Copy link

Go API Changes

# github.com/adjust/rmq/v5
## compatible changes
(*TestBatchConsumer).Consumed: added
(*TestBatchConsumer).Last: added
(*TestConsumer).Deliveries: added
(*TestConsumer).Last: added

# summary
Inferred base version: v5.0.2
Suggested version: v5.1.0

@github-actions
Copy link

Benchmark Result

Benchmark diff with base branch
name     old time/op    new time/op    delta
Queue-2     176µs ± 2%     174µs ± 6%   ~     (p=0.792 n=5+6)

name     old alloc/op   new alloc/op   delta
Queue-2    45.5kB ± 3%    45.0kB ± 7%   ~     (p=0.485 n=6+6)

name     old allocs/op  new allocs/op  delta
Queue-2      87.7 ± 1%      88.0 ± 0%   ~     (p=0.545 n=6+5)
Benchmark result
name     time/op
Queue-2   174µs ± 6%

name     alloc/op
Queue-2  45.0kB ± 7%

name     allocs/op
Queue-2    88.0 ± 0%

@github-actions
Copy link

Unit Test Coverage

total: (statements) 70.1%
changed lines: (statements) 100.0%

Coverage of changed lines
File Function Coverage
Total 100.0%
test_batch_consumer.go 100.0%
test_batch_consumer.go:22 Last 100.0%
test_batch_consumer.go:29 Consumed 100.0%
test_batch_consumer.go:36 Consume 100.0%
test_batch_consumer.go:50 Finish 100.0%
test_consumer.go 100.0%
test_consumer.go:36 Last 100.0%
test_consumer.go:43 Deliveries 100.0%
test_consumer.go:50 Consume 100.0%
Coverage diff with base branch
File Function Base Coverage Current Coverage
Total 69.4% 70.1% (+0.7%)
github.com/adjust/rmq/v5/test_batch_consumer.go Consume 80.0% 85.7% (+5.7%)
github.com/adjust/rmq/v5/test_batch_consumer.go Consumed no function 100.0%
github.com/adjust/rmq/v5/test_batch_consumer.go Last no function 100.0%
github.com/adjust/rmq/v5/test_consumer.go Consume 77.8% 81.8% (+4.0%)
github.com/adjust/rmq/v5/test_consumer.go Deliveries no function 100.0%
github.com/adjust/rmq/v5/test_consumer.go Last no function 100.0%

@vearutop vearutop marked this pull request as ready for review January 25, 2023 16:18
@vearutop vearutop merged commit 445fd7e into master Jan 27, 2023
@vearutop vearutop deleted the race-detector branch January 27, 2023 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants