ChilliCream / ChilliCream/graphql-platform
StrawberryShake subscription returns before ready - timing issue
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.8k
- Forks
- 810
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 98
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Context:
Topic: Automated API/integration tests.
Project: dotgraphee
Issue: StrawberryShake's subscription .Watch().Subscribe() seem to return before the system is ready to receive subscriptions.
(Cleanup: .Subscribe() returns an IDisposable which is disposed by the test fixture TearDown. We didn't forget it. 😉 )
Workaround: Thread.Sleep(1000); after subscription is started. 😢
Steps to reproduce
- Set up a HotChocolate endpoint with subscriptions.
- Set up a StrawberryShake client to subscribe and trigger that subscription with a mutation.
- Create a test that calls the mutation immediately after starting the subscription, see image above. (dotgraphee is building a branch 'feature/strawberry-shake-client' that does step 1, 2 and 3.)
- Test may pass randomly or when run in isolation. Create several or run in loop to reproduce.
Relevant log output
No response
Additional Context?
No response
Product
Strawberry Shake
Version
12.6.2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the StrawberryShake subscription .Watch().Subscribe() path and the automated integration-test setup described in the issue. Reproduce the HotChocolate endpoint and client sequence with the mutation immediately after subscription, then verify repeated runs receive the subscription without Thread.Sleep(1000).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, graphql
- Domain
- api, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100