-
Notifications
You must be signed in to change notification settings - Fork 239
Support simulating race conditions during signal draining #1895
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
Comments
Can you elaborate what you mean by a "race condition" during signal draining? Also why is this only specific to the Go SDK? |
I can share what I know, hoping Max can share more context. |
In the test environment you have full control over the timing and when things advance so if you know the workflow code you should be able to cause a race. Maybe an example workflow you had difficulty testing would help illustrate the problem? I am not sure how the test environment could know when to inject a signal to cause a race since it can't read your workflow code or predicted how it will execute.
They are a bit different, but I don't know if that really matters here. Signals are sent by a queue in Go, but the race condition exists in all SDKs and is not easily testable in any SDK so I don't think this is Go specific problem or harder in Go then other SDKs. Might be easier in Go since the test environment in Go gives more control over execution then other SDKs do. One idea is maybe the SDK can warn you if you do not check any signal channel in the last workflow task? If you are not checking a signal channel in the last workflow task you risk dropping a signal. How does that sound? |
I think @mfateev had some other ideas, maybe he can share them here?
I like that idea a lot actually. |
I was helping a customer writing tests for go workflows processing signals - I didn't know how to get complete test coverage to ensure the signal draining code gets covered tested.
Asked @mfateev: he suggested creating this feature request to support simulating race conditions during signal draining.
Describe the solution you'd like
Would love a way for Go SDK to support simulating race conditions during signal draining. Perhaps useful for other SDKs.
Describe alternatives you've considered
Skipping testing this race condition is probably good enough for now.
The text was updated successfully, but these errors were encountered: