-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add reliable race tests #368
Comments
quasilyte
added a commit
that referenced
this issue
Jan 30, 2022
This is the same trick we did with gogrep matcher. The caller is supposed to pass the state that is not shared between different threads. For the most use cases, ruleguard has worker/runner based concurrency, so it's easy to pass this state from the worker that owns that state and doesn't share it with other workers. Also added some E2E tests that compile a ruleguard binary with `-race` and run it using all test rules over the ruleguard own source code. If any of these rules cause a data race, this test fails. To avoid the slower test times, I removed the `-race` from the basic test as they do not involve any concurrent behavior anyway, so it was just a waste of time. Fixes #372 Fixes #368
quasilyte
added a commit
that referenced
this issue
Jan 30, 2022
This is the same trick we did with gogrep matcher. The caller is supposed to pass the state that is not shared between different threads. For the most use cases, ruleguard has worker/runner based concurrency, so it's easy to pass this state from the worker that owns that state and doesn't share it with other workers. Also added some E2E tests that compile a ruleguard binary with `-race` and run it using all test rules over the ruleguard own source code. If any of these rules cause a data race, this test fails. To avoid the slower test times, I removed the `-race` from the basic test as they do not involve any concurrent behavior anyway, so it was just a waste of time. Fixes #372 Fixes #368
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: