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

View File

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