Wait 15 seconds before checking API

This commit is contained in:
Henry Mercer
2026-01-23 15:59:55 +00:00
parent 625ae85c0a
commit 0f3834178f
2 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -132921,6 +132921,7 @@ async function testCancellationDetection() {
);
return;
}
await new Promise((resolve8) => setTimeout(resolve8, 15e3));
const checkRunId = parseInt(checkRunIdInput, 10);
logger.info(
`[Cancellation Test] Querying jobs API for run ${runId}, attempt ${attemptNumber}, check_run_id ${checkRunId}`
@@ -132971,8 +132972,8 @@ async function run2(startedAt) {
let uploadFailedSarifResult;
let dependencyCachingUsage;
try {
await testCancellationDetection();
restoreInputs();
await testCancellationDetection();
const gitHubVersion = await getGitHubVersion();
checkGitHubVersionInRange(gitHubVersion, logger);
const repositoryNwo = getRepositoryNwo();
+6 -3
View File
@@ -64,6 +64,9 @@ async function testCancellationDetection(): Promise<void> {
return;
}
// Wait 15 seconds to ensure that the API has caught up with the job status
await new Promise((resolve) => setTimeout(resolve, 15000));
const checkRunId = parseInt(checkRunIdInput, 10);
logger.info(
`[Cancellation Test] Querying jobs API for run ${runId}, attempt ${attemptNumber}, check_run_id ${checkRunId}`,
@@ -127,12 +130,12 @@ async function run(startedAt: Date) {
| undefined;
let dependencyCachingUsage: DependencyCachingUsageReport | undefined;
try {
// TEMPORARY: Test cancellation detection via API
await testCancellationDetection();
// Restore inputs from `init` Action.
restoreInputs();
// TEMPORARY: Test cancellation detection via API
await testCancellationDetection();
const gitHubVersion = await getGitHubVersion();
checkGitHubVersionInRange(gitHubVersion, logger);