Skip to content

Commit a591c9a

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 3c28295 commit a591c9a

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

.github/workflows/testing.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,24 @@ jobs:
7171
run: make deps
7272

7373
- name: Run regression tests
74-
run: make test
74+
run: |
75+
make test
76+
make testrace
7577
7678
- name: Run regression tests with call_17
77-
run: make test TAGS="go_tarantool_call_17"
79+
run: |
80+
make test TAGS="go_tarantool_call_17"
81+
make testrace TAGS="go_tarantool_call_17"
7882
7983
- name: Run regression tests with msgpack.v5
80-
run: make test TAGS="go_tarantool_msgpack_v5"
84+
run: |
85+
make test TAGS="go_tarantool_msgpack_v5"
86+
make testrace TAGS="go_tarantool_msgpack_v5"
8187
8288
- name: Run regression tests with msgpack.v5 and call_17
83-
run: make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
89+
run: |
90+
make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
91+
make testrace TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
8492
8593
- name: Run fuzzing tests
8694
if: ${{ matrix.fuzzing }}
@@ -163,27 +171,31 @@ jobs:
163171
run: |
164172
source tarantool-enterprise/env.sh
165173
make test
174+
make testrace
166175
env:
167176
TEST_TNT_SSL: ${{matrix.ssl}}
168177

169178
- name: Run regression tests with call_17
170179
run: |
171180
source tarantool-enterprise/env.sh
172181
make test TAGS="go_tarantool_call_17"
182+
make testrace TAGS="go_tarantool_call_17"
173183
env:
174184
TEST_TNT_SSL: ${{matrix.ssl}}
175185

176186
- name: Run regression tests with msgpack.v5
177187
run: |
178188
source tarantool-enterprise/env.sh
179189
make test TAGS="go_tarantool_msgpack_v5"
190+
make testrace TAGS="go_tarantool_msgpack_v5"
180191
env:
181192
TEST_TNT_SSL: ${{matrix.ssl}}
182193

183194
- name: Run regression tests with msgpack.v5 and call_17
184195
run: |
185196
source tarantool-enterprise/env.sh
186197
make test TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
198+
make testrace TAGS="go_tarantool_msgpack_v5,go_tarantool_call_17"
187199
env:
188200
TEST_TNT_SSL: ${{matrix.ssl}}
189201

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1010

1111
### Added
1212

13+
- A Makefile target to test with race detector (#218)
14+
1315
### Changed
1416

1517
### Fixed
1618

19+
- Several non-critical data race issues (#218)
20+
1721
## [1.10.0] - 2022-12-31
1822

1923
The release improves compatibility with new Tarantool versions.

CONTRIBUTING.md

+7
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

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ test:
4646
testdata:
4747
(cd ./testdata; ./generate.sh)
4848

49+
.PHONY: testrace
50+
testrace:
51+
@echo "Running all packages tests with data race detector"
52+
go clean -testcache
53+
go test -race -tags "$(TAGS)" ./... -v -p 1
54+
4955
.PHONY: test-connection-pool
5056
test-connection-pool:
5157
@echo "Running tests in connection_pool package"

0 commit comments

Comments
 (0)