-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Bug] Wait_condition timeout makes tests impossible #792
Comments
Thanks for the replication! We are investigating... |
Ok, preliminary research has shown the issue here is that the I will confer with the team to see if we want to consider allowing all cases of |
I have opened #798 |
Thank you! When I catch the exception in my minimum reproduction it works... unless I add the following discrete test:
|
Maybe what I'd really like is better introspection so I'd have a chance to look into why these tests are hanging myself |
Not following what is meant here, are you saying this test does not pass?
Yes by default workflow task failures cause workflow suspension and often you need the UI or need to ask for the history to see that a workflow is suspended pending task failure. Setting the worker init option |
Yes, the test I shared locks up as well. |
I have updated the minimum reproduction branch with 2 commits. One fixes the first workflow, the second adds this other broken test. |
This does not happen for me. Taking your exact sample from https://github.com/Vaelatern/-minimum-reproduction/tree/temporal-py-792 and applying diff --git a/main.py b/main.py
index 3e1619d..b4735c4 100644
--- a/main.py
+++ b/main.py
@@ -14,7 +14,10 @@ class WaitAMinuteWorkflow:
@workflow.run
async def run(self) -> str:
self.is_poked = False
- await workflow.wait_condition(lambda: self.is_poked, timeout=timedelta(minutes=1))
+ try:
+ await workflow.wait_condition(lambda: self.is_poked, timeout=timedelta(minutes=1))
+ except asyncio.TimeoutError as e:
+ pass
return "all done"
@workflow.signal
EDIT: I see your update, will test your latest commits |
The error you are getting now is:
I'd recommend passing |
That's the core issue! Finally worked out what was wrong in my original test (invoked activities that were not registered) by chasing down reasons like with this thread. Thank you! |
What are you really trying to do?
Have a workflow that times out when it has not received a signal in X hours. [works]
Test that workflow. [doesn't work]
Describe the bug
hangs forever until killed. See above where test_main_broken was killed after 7 minutes despite containing a sleep for
timedelta(minutes=1)
(and that shouldn't matter because: timeskip.)Minimal Reproduction
Branch here ready to clone with minimal code
Environment/Versions
Additional context
Is there another way, using asyncio.sleep() instead, to have the same result?
The text was updated successfully, but these errors were encountered: