-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Make TaskManager health status error/warning reasons more visible #154045
Changes from all commits
7840216
2f3762f
1b5e5cf
9a1df12
1ea7be8
7cf2e31
ea33657
c4cd4fc
ed667eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -375,24 +375,24 @@ describe('Task Run Statistics', () => { | |
{ Success: 40, RetryScheduled: 40, Failed: 20, status: 'OK' }, | ||
]); | ||
|
||
expect(logger.debug).toHaveBeenCalledTimes(5); | ||
expect(logger.debug).toHaveBeenNthCalledWith( | ||
expect(logger.warn).toHaveBeenCalledTimes(5); | ||
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 think I'm remembering now that these MIGHT have been warns before, but they were SDH generators so we changed them to debug. But even if so, seems fair to me! |
||
expect(logger.warn).toHaveBeenNthCalledWith( | ||
1, | ||
'Health Status warn threshold has been exceeded, resultFrequencySummary.Failed (40) is greater than warn_threshold (39)' | ||
); | ||
expect(logger.debug).toHaveBeenNthCalledWith( | ||
expect(logger.warn).toHaveBeenNthCalledWith( | ||
2, | ||
'Health Status error threshold has been exceeded, resultFrequencySummary.Failed (60) is greater than error_threshold (59)' | ||
); | ||
expect(logger.debug).toHaveBeenNthCalledWith( | ||
expect(logger.warn).toHaveBeenNthCalledWith( | ||
3, | ||
'Health Status error threshold has been exceeded, resultFrequencySummary.Failed (60) is greater than error_threshold (59)' | ||
); | ||
expect(logger.debug).toHaveBeenNthCalledWith( | ||
expect(logger.warn).toHaveBeenNthCalledWith( | ||
4, | ||
'Health Status error threshold has been exceeded, resultFrequencySummary.Failed (60) is greater than error_threshold (59)' | ||
); | ||
expect(logger.debug).toHaveBeenNthCalledWith( | ||
expect(logger.warn).toHaveBeenNthCalledWith( | ||
5, | ||
'Health Status warn threshold has been exceeded, resultFrequencySummary.Failed (40) is greater than warn_threshold (39)' | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -433,11 +433,11 @@ function getHealthStatus( | |
): HealthStatus { | ||
if (resultFrequencySummary.Failed > executionErrorThreshold.warn_threshold) { | ||
if (resultFrequencySummary.Failed > executionErrorThreshold.error_threshold) { | ||
logger.debug( | ||
logger.warn( | ||
`Health Status error threshold has been exceeded, resultFrequencySummary.Failed (${resultFrequencySummary.Failed}) is greater than error_threshold (${executionErrorThreshold.error_threshold})` | ||
); | ||
} else { | ||
logger.debug( | ||
logger.warn( | ||
`Health Status warn threshold has been exceeded, resultFrequencySummary.Failed (${resultFrequencySummary.Failed}) is greater than warn_threshold (${executionErrorThreshold.warn_threshold})` | ||
); | ||
} | ||
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. Interesting that we don't return a negative HealthStatus here. But feels like it makes sense, since the task errors could very likely be caused by the user somehow, and not systemic (invalid parameters used in a rule / connector) - we shouldn't set the TM plugin status based on that. But I bet we used to :-) |
||
|
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.
These mocks were no-op, never stubbed the real function.
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.
It doesn't look like we changed anything though - except to change the return type to an object and not just the status. The parenthesized function invocations to
mockImplementation()
definitely look a little weird, but was there some kind of problem with them? They look like they could work.But they do look confusing! :-). I wonder if there's a cleanup we can do here - in another issue/PR ...