Skip to content

Add post log parser to look for repeated test runs and annotate as in… #8696

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jmaher
Copy link
Collaborator

@jmaher jmaher commented May 13, 2025

…termittent.

@jmaher
Copy link
Collaborator Author

jmaher commented May 13, 2025

this is a WIP with an intentional failure where I would add unittests. I don't want to spend the time adding tests until I know this is something we want.

@jmaher jmaher self-assigned this May 14, 2025
@jmaher jmaher marked this pull request as draft May 14, 2025 12:49
@jmaher jmaher force-pushed the cfparser branch 5 times, most recently from 9f30375 to 52cf693 Compare June 9, 2025 20:30
@jmaher
Copy link
Collaborator Author

jmaher commented Jun 9, 2025

I have tests (I feel they are hacky), and need to review my code to make it more presentable.

There are a couple missing things:

before landing/review:

  • only run on staging

before production (ideally):

  • determine if classification_id = 4 is desired or another id (even a new one)
  • see if there is a creative way to deal with "infra" failures- I have some comments indicating desired state

@jmaher
Copy link
Collaborator Author

jmaher commented Jun 10, 2025

latest code is ready for review and will run everywhere except production.

@jmaher jmaher requested a review from Archaeopteryx June 10, 2025 16:55
@jmaher jmaher marked this pull request as ready for review June 11, 2025 21:04
@jmaher
Copy link
Collaborator Author

jmaher commented Jun 15, 2025

@Archaeopteryx I have added another commit to include the new failure classification id, sort of using https://github.com/mozilla/treeherder/blame/3f44c1dbf610206b123c2c3c466e2be5d8da6176/treeherder/model/fixtures/failure_classification.json#L38 as a template.

continue
if counter < 0:
continue
if current_job.repository.id == 77 and counter >= 20:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This condition will never be true because the elif evaluates to True for a lower counter value.

# get list of pushes
ids = Push.objects.filter(repository__id=current_job.repository.id).values("id")[:20]
# get list of pushes, find the current push and recent pushes
idlist = Push.objects.filter(repository__id=current_job.repository.id).values("id")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will return a list of hundred thousands of pushes for autoland. Possible solutions:

  1. order_by("-id")[-100] or similar, discard "current" pushes which have a lower ID. Let the for loop run.
  2. A union of the current push ID with the push IDs of queryset for the latest pushes before and the earliest after.


all_groups = (
Group.objects.filter(
job_logs__job__push__id__in=ids,
job_logs__job__push__id__range=(ids[-1],ids[0]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

ids has no guaranteed order. This looks risky. Can ids be explicitly ordered before?

@@ -54,7 +41,7 @@ def check_and_mark_intermittent(job_id):
"job_logs__job__job_type__name",
"job_logs__job__push__id",
)
.order_by("-job_logs__job__push__id")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why the change? ID as primary key should be indexed and faster than time.

Copy link
Collaborator

@Archaeopteryx Archaeopteryx left a comment

Choose a reason for hiding this comment

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

Back to "Request changes" for the comments added today.

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.

2 participants