Skip to content

Conversation

@drazisil-codecov
Copy link
Contributor

  • Introduced tests to verify that blocking_timeout=None causes indefinite blocking, preventing retry logic from functioning correctly.
  • Added a test to ensure that a valid blocking_timeout enables retry logic by raising LockError.
  • Updated BundleAnalysisProcessorTask tests to confirm that the default blocking_timeout is used, preventing indefinite blocking.
  • Adjusted assertions to reflect changes in retry logic and blocking_timeout handling.

- Introduced tests to verify that blocking_timeout=None causes indefinite blocking, preventing retry logic from functioning correctly.
- Added a test to ensure that a valid blocking_timeout enables retry logic by raising LockError.
- Updated BundleAnalysisProcessorTask tests to confirm that the default blocking_timeout is used, preventing indefinite blocking.
- Adjusted assertions to reflect changes in retry logic and blocking_timeout handling.
@drazisil-codecov drazisil-codecov marked this pull request as ready for review December 8, 2025 14:53
@sentry
Copy link

sentry bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.87%. Comparing base (6db2ae8) to head (7028cee).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   93.87%   93.87%           
=======================================
  Files        1284     1284           
  Lines       46667    46667           
  Branches     1522     1522           
=======================================
  Hits        43809    43809           
  Misses       2548     2548           
  Partials      310      310           
Flag Coverage Δ
workerintegration 58.60% <ø> (ø)
workerunit 91.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codecov-eu
Copy link

codecov-eu bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codecov-notifications
Copy link

codecov-notifications bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@thomasrockhu-codecov thomasrockhu-codecov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With all the comments, it's really difficult to understand what is going on in the tests, please update to make it human-readable

blocking_timeouts = []
lock_called = threading.Event()

def mock_lock(*args, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably shouldn't be function in a function here and more of a helper

Comment on lines +310 to +318
if kwargs.get("blocking_timeout") is None:
# With blocking_timeout=None, Redis blocks forever and never raises LockError
# This simulates the blocking behavior - it would hang indefinitely
# We use a longer sleep to ensure the thread hangs
time.sleep(1.0) # Simulate blocking (longer than thread timeout)
return blocking_lock
else:
# With blocking_timeout set, Redis raises LockError immediately
raise LockError()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if kwargs.get("blocking_timeout") is None:
# With blocking_timeout=None, Redis blocks forever and never raises LockError
# This simulates the blocking behavior - it would hang indefinitely
# We use a longer sleep to ensure the thread hangs
time.sleep(1.0) # Simulate blocking (longer than thread timeout)
return blocking_lock
else:
# With blocking_timeout set, Redis raises LockError immediately
raise LockError()
if kwargs.get("blocking_timeout") is not None:
raise LockError()
time.sleep(1.0)
return blocking_lock

I think this is a better pardigm

# With blocking_timeout set, Redis raises LockError immediately
raise LockError()

mock_redis.lock = mock_lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is necessary

exception_raised = []
completed = threading.Event()

def test_locked():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I don't love all these helper functions for just one test function. either pull it out or not. also, are all these excepts really necessary? it seems like it's just confusing the code

Comment on lines +340 to +342
thread = threading.Thread(target=test_locked)
thread.daemon = True
thread.start()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we're doing threading code, perhaps it should exist in a separate helper function as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants