Andrushika commented on code in PR #72701:
URL: https://github.com/apache/airflow/pull/72701#discussion_r3958274117
##########
providers/snowflake/tests/unit/snowflake/operators/test_snowpark_containers.py:
##########
@@ -173,7 +173,7 @@ def test_poll_waits_through_pending_then_done(self,
mock_hook_cls, mock_sleep):
[(True, True), (False, False)],
)
@mock.patch("time.sleep")
- @mock.patch("time.monotonic", side_effect=itertools.count(0, 20))
+ @mock.patch("time.monotonic", side_effect=[0, 5, 10])
Review Comment:
Sorry, after a closer look I think I was wrong here. The `itertools.count`
in the original suggestion was on purpose, to keep the patched clock from
running out if anything else reads `time.monotonic` during the test:
https://github.com/apache/airflow/pull/70103#discussion_r3956945221
So maybe keep the unbounded counter, just with a step that fits the 10s
timeout, e.g. `itertools.count(0, 5)` (0, 5, 10) plus the missing `import
itertools`. `count(0, 20)` hits the deadline on the first check, which is the
other failure you found.
##########
providers/snowflake/tests/unit/snowflake/operators/test_snowpark_containers.py:
##########
@@ -173,7 +173,7 @@ def test_poll_waits_through_pending_then_done(self,
mock_hook_cls, mock_sleep):
[(True, True), (False, False)],
)
@mock.patch("time.sleep")
- @mock.patch("time.monotonic", side_effect=itertools.count(0, 20))
+ @mock.patch("time.monotonic", side_effect=[0, 5, 10])
Review Comment:
cc @potiuk since it was your suggestion in #70103, in case I read it wrong.
wdyt?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]