locking test improvements

pull/496/head
Frostebite 2023-02-14 00:41:23 +00:00
parent 999ca1ba26
commit fcc3348295
2 changed files with 16 additions and 17 deletions

View File

@ -169,24 +169,23 @@ class Kubernetes implements ProviderInterface {
}
await this.cleanupTaskResources();
} catch (error: any) {
// let errorParsed;
// try {
// // errorParsed = JSON.parse(error);
// } catch {
// // errorParsed = error;
// }
let errorParsed;
try {
errorParsed = JSON.parse(error);
} catch {
errorParsed = error;
}
// const errorMessage =
// errorParsed.name || errorParsed.reason || errorParsed.response?.body?.reason || errorParsed.message;
const errorMessage =
errorParsed.name || errorParsed.reason || errorParsed.response?.body?.reason || errorParsed.message;
const continueStreaming = false;
// errorMessage.includes(`dial timeout, backstop`) ||
// errorMessage.includes(`HttpError`) ||
// errorMessage.includes(`HttpError: HTTP request failed`) ||
// errorMessage.includes(`an error occurred when try to find container`) ||
// errorMessage.includes(`not found`) ||
// errorMessage.includes(`Not Found`);
const continueStreaming =
errorMessage.includes(`dial timeout, backstop`) ||
errorMessage.includes(`HttpError`) ||
errorMessage.includes(`HttpError: HTTP request failed`) ||
errorMessage.includes(`an error occurred when try to find container`) ||
errorMessage.includes(`not found`) ||
errorMessage.includes(`Not Found`);
if (continueStreaming) {
CloudRunnerLogger.log('Log Stream Container Not Found');
await new Promise((resolve) => resolve(5000));

View File

@ -123,7 +123,7 @@ class KubernetesTaskRunner {
await waitUntil(
async () => {
const status = await kubeClient.readNamespacedPodStatus(podName, namespace);
const events = await kubeClient.readNamespacedEvent(podName, namespace);
const events = await kubeClient.listNamespacedEvent(namespace);
const phase = status?.body.status?.phase;
success = phase === 'Running';
CloudRunnerLogger.log(