You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To Reproduce
Create multiple instance of fuego.Server in different goroutines.
I have create a simple repository to showcase the problem over here. But for sake of completeness here the test used:
Expected behavior
The data race should not happen.
Framework version:
Tested on v0.14.0 and main at the time of writing (f386d4f).
Go version:
v1.23.2
Additional context
This prevent running tests that exercise the entire server in parallel, but does not affect unit test of handlers as far as I understand.
The root cause is the package global variable generator at line 151 in openapi.go being shared and concurrently used by every fuego.Server instances.
See #202 for a potential fix.
Huge thanks for your work, I really enjoy using fuego!
The text was updated successfully, but these errors were encountered:
No worries. The reason is purely to be able to run tests in parallel.
I took the habit of making every test that I can run in parallel with t.Parallel() and in some of my tests I want to test the entire "stack" including middlewares that should be trigger when calling a specific endpoint, thus these tests create multiple fuego.Server instances in parallel leading to the data race.
To Reproduce
Create multiple instance of
fuego.Server
in different goroutines.I have create a simple repository to showcase the problem over here. But for sake of completeness here the test used:
Expected behavior
The data race should not happen.
Framework version:
Tested on v0.14.0 and main at the time of writing (f386d4f).
Go version:
v1.23.2
Additional context
This prevent running tests that exercise the entire server in parallel, but does not affect unit test of handlers as far as I understand.
The root cause is the package global variable
generator
at line 151 in openapi.go being shared and concurrently used by everyfuego.Server
instances.See #202 for a potential fix.
Huge thanks for your work, I really enjoy using fuego!
The text was updated successfully, but these errors were encountered: