-
Notifications
You must be signed in to change notification settings - Fork 3.6k
AAP-45541 Add test to recreate jobs/4075584/job_events/children_summary/ error #16163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
from test failure, not the same as your expectation? |
|
Accidentally left a breakpoint() in the code. Think of this PR as pseudo code. My point was to show creating an event with event='' recreates the reported error. |
|
Now it gives this which is intended: |
* Also begin to add detection for empty event
| ).save() | ||
| JobEvent.create_from_data(job_id=job.pk, uuid='uuid4', parent_uuid='', event='verbose', counter=4, stdout='a' * 1024, job_created=job.created).save() | ||
|
|
||
| JobEvent.create_from_data(job_id=job.pk, uuid='uuid4', parent_uuid='', event='', counter=5, stdout='a' * 1024, job_created=job.created).save() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Duplicate uuid in test creates incorrect data mapping
The empty event at line 163 uses uuid='uuid4', which duplicates the uuid from the verbose event at line 161. In the existing test patterns, each event has a unique uuid. This causes the map_uuid_counter dictionary to map uuid4 to counter 5 (empty event) instead of counter 4 (verbose event), since the later event overwrites the earlier one. While this doesn't break the current test (no event uses parent_uuid='uuid4'), it creates inconsistent test data that could mask bugs or cause failures if the test is extended.
|
| for i, e in enumerate(events): | ||
| if not e['event']: | ||
| logging.warning(f'event type missing for event {e}') | ||
| continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my only remaining question is if this continue is necessary or if we could just handle these events within the rest of the logic. But either way.
I'm not sure how we can get into this state (where event is empty). Best we can do for now (until we get an actual reproducer) is log when it happens and try not to include/process the malformed event so that we still return a usuable event tree.
SUMMARY
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
Note
Handle empty/missing job event types in job_events children_summary with safe skipping and logging; add functional test coverage.
eventinJobJobEventsChildrenSummary.get, logging a warning instead of erroring.''as meta when scanning ahead to determine parentage for meta events; avoidKeyErrorand preserve tree processing.test_job_job_events_children_summary_empty_eventto verify correct behavior when an event has an emptyeventfield.Written by Cursor Bugbot for commit 3f251e0. This will update automatically on new commits. Configure here.