-
Notifications
You must be signed in to change notification settings - Fork 77
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
Fix Dr.CI flaky FP when GH fails to dispatch the workflow #4998
Merged
huydhn
merged 1 commit into
pytorch:main
from
huydhn:drci-do-not-mark-missing-workflow-as-flaky
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,6 +334,7 @@ describe("Test various utils used by Dr.CI", () => { | |
}); | ||
|
||
test("test isInfraFlakyJob", () => { | ||
// Not a workflow job | ||
const notInfraFlakyFailure: RecentWorkflowsData = { | ||
id: "A", | ||
name: "A", | ||
|
@@ -348,8 +349,13 @@ describe("Test various utils used by Dr.CI", () => { | |
}; | ||
expect(isInfraFlakyJob(notInfraFlakyFailure)).toEqual(false); | ||
|
||
// Set the workflow ID to mark this as a workflow job | ||
notInfraFlakyFailure.workflowId = "A"; | ||
expect(isInfraFlakyJob(notInfraFlakyFailure)).toEqual(false); | ||
|
||
const notInfraFlakyFailureAgain: RecentWorkflowsData = { | ||
id: "A", | ||
workflowId: "A", | ||
name: "A", | ||
html_url: "A", | ||
head_sha: "A", | ||
|
@@ -364,6 +370,7 @@ describe("Test various utils used by Dr.CI", () => { | |
|
||
const isInfraFlakyFailure: RecentWorkflowsData = { | ||
id: "A", | ||
workflowId: "A", | ||
name: "A", | ||
html_url: "A", | ||
head_sha: "A", | ||
|
@@ -381,8 +388,8 @@ describe("Test various utils used by Dr.CI", () => { | |
const mockJobUtils = jest.spyOn(jobUtils, "hasS3Log"); | ||
mockJobUtils.mockImplementation(() => Promise.resolve(true)); | ||
|
||
// Has log and failure lines | ||
const validFailure: RecentWorkflowsData = { | ||
// Not a workflow job | ||
const mockFailure: RecentWorkflowsData = { | ||
id: "A", | ||
name: "A", | ||
html_url: "A", | ||
|
@@ -394,11 +401,16 @@ describe("Test various utils used by Dr.CI", () => { | |
head_branch: "whatever", | ||
runnerName: "dummy", | ||
}; | ||
expect(await isLogClassifierFailed(validFailure)).toEqual(false); | ||
expect(await isLogClassifierFailed(mockFailure)).toEqual(false); | ||
|
||
// Has log and failure lines and is a workflow job | ||
mockFailure.workflowId = "A"; | ||
expect(await isLogClassifierFailed(mockFailure)).toEqual(false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this line supposed to be the same as the one above it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tries to add 2 tests here:
So yeah, both of them expect false as the returned value. |
||
|
||
// Has log but not failure lines (log classifier not triggered) | ||
const logClassifierNotTriggered: RecentWorkflowsData = { | ||
id: "A", | ||
workflowId: "A", | ||
name: "A", | ||
html_url: "A", | ||
head_sha: "A", | ||
|
@@ -415,7 +427,7 @@ describe("Test various utils used by Dr.CI", () => { | |
|
||
// No S3 log | ||
mockJobUtils.mockImplementation(() => Promise.resolve(false)); | ||
expect(await isLogClassifierFailed(validFailure)).toEqual(true); | ||
expect(await isLogClassifierFailed(mockFailure)).toEqual(true); | ||
}); | ||
|
||
test("test isExcludedFromFlakiness", () => { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
maybe im reading this wrong, but do you have any tests where it would have been flaky if it were a workflow job, but not if it is a workflow run?
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.
There are examples from the original PR #4622 that implements
isInfraFlakyJob
. They were all jobs that weren't run. GitHub records are gone, but they are still shown on HUD https://hud.pytorch.org/pr/110608There 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.
By querying Rockset, I can confirm that there were infra flaky jobs from 110608. Here is an example:
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.
Sorry what I mean is that I don't see tests where the existence of a workflowID has an effect on the output of the function, I only see cases that returned false regardless of whether or not the workflowID is there. This makes me think that the original code would have also returned false, so I'm confused as to if the code works, am I missing something?