-
Notifications
You must be signed in to change notification settings - Fork 55
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
[SYNTH-16456] Postpone reporting results on 404 #1480
base: master
Are you sure you want to change the base?
[SYNTH-16456] Postpone reporting results on 404 #1480
Conversation
isNonFinal: isNonFinalResult(resultInBatch), | ||
location: getLocation(resultInBatch.location, test), | ||
passed: hasResultPassed(resultInBatch, false, hasTimedOut, options), | ||
result: {} as ServerResult, |
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.
If we don't need this, could we rather make it optional?
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'm afraid of how it could break customer's code. I'll check internally (web-ui and CI integrations)
@@ -268,6 +274,31 @@ const getResultFromBatch = ( | |||
} | |||
} | |||
|
|||
const getResultWithoutPollResult = ( |
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.
Given the similarity between this function and the return statement from the above, could we merge the two, and add only the difference if pollResult
is not available?
const resultFromBatch = {
executionRule: resultInBatch.execution_rule,
initialResultId: resultInBatch.initial_result_id,
isNonFinal: isNonFinalResult(resultInBatch),
location: getLocation(resultInBatch.location, test),
passed: hasResultPassed(resultInBatch, isUnhealthy, hasTimedOut, options),
resultId: getResultIdOrLinkedResultId(resultInBatch),
retries: resultInBatch.retries || 0,
maxRetries: resultInBatch.max_retries || 0,
selectiveRerun: resultInBatch.selective_rerun,
timedOut: hasTimedOut,
}
if (pollResult) {
return {
...resultFromBatch,
result: {
...pollResult.result,
...(safeDeadlineReached ? {
failure: new BatchTimeoutRunawayError().toJson()
passed: false
} : timedOutRetry || hasTimedOut ? {
failure: new {code: 'TIMEOUT', message: 'The batch timed out before receiving the result.'}
passed: false
} : {})
},
test: deepExtend({}, test, pollResult),
timestamp: pollResult.timestamp
}
} else {
return {
...resultFromBatch,
test: deepExtend({}, test),
timestamp: Date.now()
}
}
This code might not be the best solution, but will hopefully give you an idea.
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.
This way would make it more concise, but i'm not sure if having the two functions is not actually clearer and easier to understand 🤔
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 prefer the 2 functions as well tbh 😁
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.
Apart from the question the Etienne has raised LGTM 👍
What and why?
There is sometimes some latency between batches and the poll results endpoint. When this happens, the poll results endpoint may return a 404 error because some queried results cannot be found, so the request ends up returning nothing.
Currently, we retry 3 times on 404 errors for that endpoint, and if the request never succeeds, datadog-ci quits and the CI fails.
How?
The information for result {resultId} of test {publicId} was incomplete at the end of the batch.
Review checklist