Skip to content

Commit

Permalink
Fix side effects in AWS Batch Executor test (#39474)
Browse files Browse the repository at this point in the history
This wasted a lot of my hours in debugging failures for #39450

This was modifying a global env vars and causing side effects in other tests
  • Loading branch information
kaxil authored May 8, 2024
1 parent f00006d commit 9a50475
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,9 @@ def test_start_health_check_config(self, set_env_vars):
batch_mock.describe_jobs.side_effect = {}
executor.batch = batch_mock

os.environ[f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllBatchConfigKeys.CHECK_HEALTH_ON_STARTUP}".upper()] = (
"False"
)

executor.start()
env_var_key = f"AIRFLOW__{CONFIG_GROUP_NAME}__{AllBatchConfigKeys.CHECK_HEALTH_ON_STARTUP}".upper()
with mock.patch.dict(os.environ, {env_var_key: "False"}):
executor.start()

batch_mock.describe_jobs.assert_not_called()

Expand Down

0 comments on commit 9a50475

Please sign in to comment.