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

enttest.Open is not goroutine-safe #2662

Closed
tmc opened this issue Jun 18, 2022 · 1 comment · Fixed by #2665
Closed

enttest.Open is not goroutine-safe #2662

tmc opened this issue Jun 18, 2022 · 1 comment · Fixed by #2665

Comments

@tmc
Copy link
Contributor

tmc commented Jun 18, 2022

Concurrent calls to enttest.Open() (which you might encounter when parallelizing test runs via t.Parallel()) encounter a data race in the lazy/unsychronized initialization of t.columns in func (m *Migrate) setupTable(t *Table) {.

@a8m
Copy link
Member

a8m commented Jun 19, 2022

Hey @tmc and thanks for reporting this. I can work around this by either adding a lock to the migration or copying the tables. I think the latter is preferred but requires more work.

I'll give it a try and update you.

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 a pull request may close this issue.

2 participants