Skip to content

fix: Resolve LogRecord attribute conflict in event manager logging#802

Merged
vdusek merged 2 commits intomasterfrom
fix/event-manager-logging-conflicts
Feb 18, 2026
Merged

fix: Resolve LogRecord attribute conflict in event manager logging#802
vdusek merged 2 commits intomasterfrom
fix/event-manager-logging-conflicts

Conversation

@vdusek
Copy link
Contributor

@vdusek vdusek commented Feb 18, 2026

Summary

  • Renamed extra={'message': message} to extra={'raw_message': message} in ApifyEventManager._process_platform_messages — the message key overwrites Python's built-in LogRecord.message attribute, corrupting the log record (especially visible on Python 3.13+).
  • Added caplog.set_level(logging.INFO, logger='apify') to test_unknown_event_is_logged — the unknown event is logged at INFO level but caplog only captures WARNING+ by default, causing the assertion to always fail.

Test plan

  • CI passes

🤖 Generated with Claude Code

The `extra={'message': message}` in the exception handler overwrites
Python's built-in `LogRecord.message` attribute, corrupting the log
record and preventing caplog from capturing it (especially on 3.13+).
Renamed to `raw_message` to avoid the collision.

Also fixed `test_unknown_event_is_logged` which was missing an explicit
`caplog.set_level(logging.INFO)` — the unknown event is logged at INFO
level but caplog only captures WARNING+ by default.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Feb 18, 2026
@vdusek vdusek self-assigned this Feb 18, 2026
@vdusek vdusek requested a review from Pijukatel February 18, 2026 09:29
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 18, 2026
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (c07461e) to head (f85094c).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #802      +/-   ##
==========================================
+ Coverage   85.50%   85.54%   +0.03%     
==========================================
  Files          46       46              
  Lines        2691     2691              
==========================================
+ Hits         2301     2302       +1     
+ Misses        390      389       -1     
Flag Coverage Δ
e2e ?
integration 57.63% <0.00%> (+0.03%) ⬆️
unit 72.46% <100.00%> (ø)

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.

# Conflicts:
#	tests/unit/events/test_apify_event_manager.py
@vdusek vdusek merged commit e1bdbc9 into master Feb 18, 2026
28 of 29 checks passed
@vdusek vdusek deleted the fix/event-manager-logging-conflicts branch February 18, 2026 11:13
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. claude-code-assisted 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.

2 participants