File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 1616
1717import pytest
1818import numpy as np
19- from airflow import utils
20- from airflow import DAG
21- from airflow .providers .amazon .aws .operators .sagemaker import SageMakerTrainingOperator
22- from airflow .providers .amazon .aws .operators .sagemaker_transform import SageMakerTransformOperator
19+ from configparser import ParsingError
20+ from sagemaker .utils import retries
21+
2322from six .moves .urllib .parse import urlparse
2423
2524import tests .integ
4948from tests .integ .record_set import prepare_record_set_from_local_files
5049from tests .integ .timeout import timeout
5150
51+ for _ in retries (
52+ max_retry_count = 10 , # 10*6 = 1min
53+ exception_message_prefix = "airflow import " ,
54+ seconds_to_sleep = 6 ,
55+ ):
56+ try :
57+ from airflow import utils
58+ from airflow import DAG
59+ from airflow .providers .amazon .aws .operators .sagemaker import SageMakerTrainingOperator
60+ from airflow .providers .amazon .aws .operators .sagemaker_transform import (
61+ SageMakerTransformOperator ,
62+ )
63+
64+ break
65+ except ParsingError :
66+ pass
67+
5268PYTORCH_MNIST_DIR = os .path .join (DATA_DIR , "pytorch_mnist" )
5369PYTORCH_MNIST_SCRIPT = os .path .join (PYTORCH_MNIST_DIR , "mnist.py" )
5470AIRFLOW_CONFIG_TIMEOUT_IN_SECONDS = 10
You can’t perform that action at this time.
0 commit comments