Skip to content

Commit 399dc42

Browse files
committed
Retry ValueError for airflow tests
This change adds a retry to import utils from airflow in case it trys to load util from local module instead of airflow dependency
1 parent 11ff7c0 commit 399dc42

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/integ/test_airflow_config.py

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from __future__ import absolute_import
1414

1515
import os
16+
import sys
1617

1718
import pytest
1819
import numpy as np
@@ -54,6 +55,7 @@
5455
seconds_to_sleep=6,
5556
):
5657
try:
58+
print(sys.modules)
5759
from airflow import utils
5860
from airflow import DAG
5961
from airflow.providers.amazon.aws.operators.sagemaker import SageMakerTrainingOperator
@@ -64,6 +66,11 @@
6466
break
6567
except ParsingError:
6668
pass
69+
except ValueError as ve:
70+
if "Unable to configure formatter" in str(ve):
71+
print(f"Received: {ve}")
72+
else:
73+
raise ve
6774

6875
PYTORCH_MNIST_DIR = os.path.join(DATA_DIR, "pytorch_mnist")
6976
PYTORCH_MNIST_SCRIPT = os.path.join(PYTORCH_MNIST_DIR, "mnist.py")

0 commit comments

Comments
 (0)