Skip to content

Commit f300bd9

Browse files
committed
ci: add tests with data race detector
Tests execution result may differ due to different timings, so it is better to test together, rather than instead. Closes #218
1 parent 81a613d commit f300bd9

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

.github/workflows/testing.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,24 @@ jobs:
9797
run: make deps
9898

9999
- name: Run regression tests
100-
run: make test
100+
run: |
101+
make test
102+
make testrace
101103
102104
- name: Run regression tests with call_17
103-
run: make test TAGS="go_tarantool_call_17"
105+
run: |
106+
make test TAGS="go_tarantool_call_17"
107+
make testrace TAGS="go_tarantool_call_17"
104108
105109
- name: Run regression tests with msgpack.v5
106-
run: make test TAGS="go_tarantool_msgpack_v5"
110+
run: |
111+
make test TAGS="go_tarantool_msgpack_v5"
112+
make testrace TAGS="go_tarantool_msgpack_v5"
107113
108114
- name: Run regression tests with msgpack.v5 and call_17
109-
run: make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
115+
run: |
116+
make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
117+
make testrace TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
110118
111119
- name: Run fuzzing tests
112120
if: ${{ matrix.fuzzing }}
@@ -189,27 +197,31 @@ jobs:
189197
run: |
190198
source tarantool-enterprise/env.sh
191199
make test
200+
make testrace
192201
env:
193202
TEST_TNT_SSL: ${{matrix.ssl}}
194203

195204
- name: Run regression tests with call_17
196205
run: |
197206
source tarantool-enterprise/env.sh
198207
make test TAGS="go_tarantool_call_17"
208+
make testrace TAGS="go_tarantool_call_17"
199209
env:
200210
TEST_TNT_SSL: ${{matrix.ssl}}
201211

202212
- name: Run regression tests with msgpack.v5
203213
run: |
204214
source tarantool-enterprise/env.sh
205215
make test TAGS="go_tarantool_msgpack_v5"
216+
make testrace TAGS="go_tarantool_msgpack_v5"
206217
env:
207218
TEST_TNT_SSL: ${{matrix.ssl}}
208219

209220
- name: Run regression tests with msgpack.v5 and call_17
210221
run: |
211222
source tarantool-enterprise/env.sh
212223
make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
224+
make testrace TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
213225
env:
214226
TEST_TNT_SSL: ${{matrix.ssl}}
215227

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1111
### Added
1212

1313
- Support pagination (#246)
14+
- A Makefile target to test with race detector (#218)
1415

1516
### Changed
1617

1718
### Fixed
1819

20+
- Several non-critical data race issues (#218)
21+
1922
## [1.10.0] - 2022-12-31
2023

2124
The release improves compatibility with new Tarantool versions.

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,26 @@ To run tests for the main package and each subpackage:
2626
make test
2727
```
2828

29+
To run tests for the main package and each subpackage with race detector:
30+
```bash
31+
make testrace
32+
```
33+
2934
The tests set up all required `tarantool` processes before run and clean up
3035
afterwards.
3136

3237
If you want to run the tests with specific build tags:
3338
```bash
3439
make test TAGS=go_tarantool_ssl_disable,go_tarantool_msgpack_v5
40+
make testrace TAGS=go_tarantool_ssl_disable,go_tarantool_msgpack_v5
3541
```
3642

3743
If you have Tarantool Enterprise Edition 2.10 or newer, you can run additional
3844
SSL tests. To do this, you need to set an environment variable 'TEST_TNT_SSL':
3945

4046
```bash
4147
TEST_TNT_SSL=true make test
48+
TEST_TNT_SSL=true make testrace
4249
```
4350

4451
If you want to run the tests for a specific package:

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ test:
5050
testdata:
5151
(cd ./testdata; ./generate.sh)
5252

53+
.PHONY: testrace
54+
testrace:
55+
@echo "Running all packages tests with data race detector"
56+
go clean -testcache
57+
go test -race -tags "$(TAGS)" ./... -v -p 1
58+
5359
.PHONY: test-connection-pool
5460
test-connection-pool:
5561
@echo "Running tests in connection_pool package"

0 commit comments

Comments
 (0)