Skip to content

Commit b91eaa1

Browse files
committed
Minor comments update
1 parent a74ed39 commit b91eaa1

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tests/test_Consumer.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
from tests.common import TestConsumer
1515

16-
# Timing constants for wakeable poll pattern tests
17-
# These are lenient ranges to accommodate CI environment variability (especially macOS)
16+
# Timing constants for wakeable poll/consume pattern tests
1817
WAKEABLE_POLL_LONGER_TIMEOUT_MIN = 0.2 # Minimum timeout for longer operations (seconds)
1918
WAKEABLE_POLL_LONGER_TIMEOUT_MAX = 2.0 # Maximum timeout for longer operations (seconds)
2019
WAKEABLE_POLL_SHORTER_TIMEOUT_MIN = 0.01 # Minimum timeout for shorter operations (seconds)
@@ -742,7 +741,6 @@ def test_calculate_chunk_timeout_utility_function():
742741
elapsed = time.time() - start
743742

744743
assert msg is None, "Assertion 2 failed: Expected None (timeout)"
745-
# More lenient for CI environments (macOS can be slower)
746744
assert WAKEABLE_POLL_LONGER_TIMEOUT_MIN <= elapsed <= WAKEABLE_POLL_LONGER_TIMEOUT_MAX, \
747745
f"Assertion 2 failed: Timeout took {elapsed:.2f}s, expected ~1.0s"
748746
consumer2.close()
@@ -898,7 +896,6 @@ def test_check_signals_between_chunks_utility_function():
898896
elapsed = time.time() - start
899897

900898
assert msg is None, "Assertion 3 failed: Expected None (timeout), no signal should not interrupt"
901-
# More lenient for CI environments (macOS can be slower)
902899
assert WAKEABLE_POLL_LONGER_TIMEOUT_MIN <= elapsed <= WAKEABLE_POLL_LONGER_TIMEOUT_MAX, \
903900
f"Assertion 3 failed: No signal timeout took {elapsed:.2f}s, expected ~0.5s"
904901
consumer3.close()
@@ -999,8 +996,7 @@ def test_wakeable_poll_utility_functions_interaction():
999996
elapsed = time.time() - start
1000997
# Chunk calculation should continue correctly (200ms each)
1001998
# Signal check should happen every chunk
1002-
# Should interrupt within ~0.8s (0.6s signal + 0.2s chunk)
1003-
# More lenient for CI environments (macOS can be slower)
999+
# Signal sent at 0.6s, should interrupt after that
10041000
msg = (f"Assertion 2 failed: Multiple chunks interaction took "
10051001
f"{elapsed:.2f}s, expected {WAKEABLE_POLL_LONGER_TIMEOUT_MIN}-{WAKEABLE_POLL_LONGER_TIMEOUT_MAX}s")
10061002
assert WAKEABLE_POLL_LONGER_TIMEOUT_MIN <= elapsed <= WAKEABLE_POLL_LONGER_TIMEOUT_MAX, msg
@@ -1080,8 +1076,7 @@ def test_wakeable_poll_interruptibility_and_messages():
10801076
assert False, "Assertion 3 failed: Should have raised KeyboardInterrupt"
10811077
except KeyboardInterrupt:
10821078
elapsed = time.time() - start
1083-
# Should interrupt within one chunk period after signal (0.6s + 0.2s = 0.8s max)
1084-
# More lenient for CI environments (macOS can be slower)
1079+
# Signal sent at 0.6s, should interrupt after that
10851080
msg = (f"Assertion 3 failed: Multiple chunks interrupt took "
10861081
f"{elapsed:.2f}s, expected {WAKEABLE_POLL_LONGER_TIMEOUT_MIN}-{WAKEABLE_POLL_LONGER_TIMEOUT_MAX}s")
10871082
assert WAKEABLE_POLL_LONGER_TIMEOUT_MIN <= elapsed <= WAKEABLE_POLL_LONGER_TIMEOUT_MAX, msg
@@ -1155,7 +1150,6 @@ def test_wakeable_poll_edge_cases():
11551150
elapsed = time.time() - start
11561151

11571152
assert msg is None, "Assertion 3 failed: Short timeout with no messages should return None"
1158-
# More lenient for CI environments (macOS can be slower)
11591153
assert WAKEABLE_POLL_SHORTER_TIMEOUT_MIN <= elapsed <= WAKEABLE_POLL_SHORTER_TIMEOUT_MAX, \
11601154
f"Assertion 3 failed: Short timeout took {elapsed:.2f}s, expected ~0.1s"
11611155
consumer3.close()
@@ -1249,8 +1243,7 @@ def test_wakeable_consume_interruptibility_and_messages():
12491243
assert False, "Assertion 3 failed: Should have raised KeyboardInterrupt"
12501244
except KeyboardInterrupt:
12511245
elapsed = time.time() - start
1252-
# Should interrupt within one chunk period after signal (0.6s + 0.2s = 0.8s max)
1253-
# More lenient for CI environments (macOS can be slower)
1246+
# Signal sent at 0.6s, should interrupt after that
12541247
msg = (f"Assertion 3 failed: Multiple chunks interrupt took "
12551248
f"{elapsed:.2f}s, expected {WAKEABLE_POLL_LONGER_TIMEOUT_MIN}-{WAKEABLE_POLL_LONGER_TIMEOUT_MAX}s")
12561249
assert WAKEABLE_POLL_LONGER_TIMEOUT_MIN <= elapsed <= WAKEABLE_POLL_LONGER_TIMEOUT_MAX, msg

0 commit comments

Comments
 (0)