Skip to content

fix: Add -race when running tests#388

Merged
kodiakhq[bot] merged 3 commits intomainfrom
run-test-with-race
Nov 10, 2022
Merged

fix: Add -race when running tests#388
kodiakhq[bot] merged 3 commits intomainfrom
run-test-with-race

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf commented Nov 10, 2022

This adds the -race flag to go test, so we can detect data races in the tests. There were two instances that I had to fix for this to succeed (not really a bug: just the test accessing a variable that another goroutine is writing to) - for now fixed using a lock around the variable.

Some other test were failing when I ran go test -race -count 3 ./... because of global variables being modified in the test. This also fixes this issue.

The only real functional change is that we now only add a _cq_id column if it is not already present.

@hermanschaaf hermanschaaf changed the title Add -race when running tests fix: Add -race when running tests Nov 10, 2022
@github-actions github-actions bot added the fix label Nov 10, 2022
Copy link
Copy Markdown
Member

@disq disq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call with -race, LGTM with one nit.

@kodiakhq kodiakhq bot merged commit 3da08bb into main Nov 10, 2022
@kodiakhq kodiakhq bot deleted the run-test-with-race branch November 10, 2022 12:34
hermanschaaf pushed a commit that referenced this pull request Nov 10, 2022
🤖 I have created a release *beep* *boop*
---


##
[1.3.2](v1.3.1...v1.3.2)
(2022-11-10)


### Bug Fixes

* Add -race when running tests
([#388](#388))
([3da08bb](3da08bb))
* Close zip archive when we're done with it
([#391](#391))
([1c4a877](1c4a877))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants