locking test improvements

pull/496/head
Frostebite 2023-02-14 01:03:24 +00:00
parent 19cd7ddf84
commit a7787b43cd
1 changed files with 9 additions and 4 deletions

View File

@ -72,10 +72,15 @@ class AWSTaskRunner {
CloudRunnerLogger.log(`Streaming...`); CloudRunnerLogger.log(`Streaming...`);
const { output, shouldCleanup } = await this.streamLogsUntilTaskStops(cluster, taskArn, streamName); const { output, shouldCleanup } = await this.streamLogsUntilTaskStops(cluster, taskArn, streamName);
await new Promise((resolve) => resolve(10000)); let exitCode;
const taskData = await AWSTaskRunner.describeTasks(cluster, taskArn); let containerState;
const containerState = taskData.containers?.[0]; let taskData;
const exitCode = containerState?.exitCode; while (exitCode === undefined) {
await new Promise((resolve) => resolve(10000));
taskData = await AWSTaskRunner.describeTasks(cluster, taskArn);
containerState = taskData.containers?.[0];
exitCode = containerState?.exitCode;
}
CloudRunnerLogger.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`); CloudRunnerLogger.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);
if (exitCode === undefined) { if (exitCode === undefined) {
CloudRunnerLogger.logWarning(`Undefined exitcode for container`); CloudRunnerLogger.logWarning(`Undefined exitcode for container`);