Skip to content

fix: Report integer count in 'Experiencing problems' status log#1860

Merged
vdusek merged 1 commit intomasterfrom
fix/walrus-precedence-failed-requests-count
Apr 27, 2026
Merged

fix: Report integer count in 'Experiencing problems' status log#1860
vdusek merged 1 commit intomasterfrom
fix/walrus-precedence-failed-requests-count

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Apr 27, 2026

Summary

The walrus operator at _basic_crawler.py:1656 binds less tightly than >, so failed_requests := X - Y > 0 was parsed as failed_requests := ((X - Y) > 0) per PEP 572. As a result, failed_requests was assigned a bool instead of the integer difference, and the periodic status log emitted:

Experiencing problems, True failed requests since last status update.

instead of the actual count.

Fix

Move the parentheses so := captures the integer subtraction and > 0 sits outside.

Regression test

Added test_status_message_reports_failed_request_count, which directly invokes _crawler_state_task with a mocked _statistics.state and a separate _previous_crawler_state, asserting the rendered message contains the integer count 3, not True.

Walrus precedence made `failed_requests := X - Y > 0` parse as
`failed_requests := ((X - Y) > 0)`, so the status log printed
'... True failed requests ...' instead of the actual count.
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Apr 27, 2026
@vdusek vdusek self-assigned this Apr 27, 2026
@vdusek vdusek requested a review from Pijukatel April 27, 2026 10:47
@github-actions github-actions Bot added this to the 139th sprint - Tooling team milestone Apr 27, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Apr 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.40%. Comparing base (3c594fe) to head (fdcdd63).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1860      +/-   ##
==========================================
- Coverage   92.41%   92.40%   -0.01%     
==========================================
  Files         158      158              
  Lines       11009    11009              
==========================================
- Hits        10174    10173       -1     
- Misses        835      836       +1     
Flag Coverage Δ
unit 92.40% <ø> (-0.01%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@Mantisus Mantisus left a comment

Choose a reason for hiding this comment

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

LGTM

@vdusek vdusek merged commit 40170a6 into master Apr 27, 2026
32 checks passed
@vdusek vdusek deleted the fix/walrus-precedence-failed-requests-count branch April 27, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants