Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 fixed flaky director-v2 test #3252

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def _get_environment_variables(
"DY_SIDECAR_PATH_OUTPUTS": f"{scheduler_data.paths_mapping.outputs_path}",
"DY_SIDECAR_PROJECT_ID": f"{scheduler_data.project_id}",
"DY_SIDECAR_RUN_ID": f"{scheduler_data.dynamic_sidecar.run_id}",
"DY_SIDECAR_STATE_EXCLUDE": json_dumps([f"{x}" for x in state_exclude]),
"DY_SIDECAR_STATE_EXCLUDE": json_dumps(f"{x}" for x in state_exclude),
"DY_SIDECAR_STATE_PATHS": json_dumps(
[f"{x}" for x in scheduler_data.paths_mapping.state_paths]
f"{x}" for x in scheduler_data.paths_mapping.state_paths
),
"DY_SIDECAR_USER_ID": f"{scheduler_data.user_id}",
"DYNAMIC_SIDECAR_COMPOSE_NAMESPACE": compose_namespace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def expected_dynamic_sidecar_spec(run_id: UUID) -> dict[str, Any]:
"DY_SIDECAR_PATH_INPUTS": "/tmp/inputs",
"DY_SIDECAR_PATH_OUTPUTS": "/tmp/outputs",
"DY_SIDECAR_PROJECT_ID": "dd1d04d9-d704-4f7e-8f0f-1ca60cc771fe",
"DY_SIDECAR_STATE_EXCLUDE": json_dumps(["/tmp/strip_me/*", "*.py"]),
"DY_SIDECAR_STATE_EXCLUDE": json_dumps({"*.py", "/tmp/strip_me/*"}),
"DY_SIDECAR_STATE_PATHS": json_dumps(
["/tmp/save_1", "/tmp_save_2"]
),
Expand Down Expand Up @@ -360,6 +360,24 @@ def test_get_dynamic_proxy_spec(
"TaskTemplate": {"ContainerSpec": {"Env": True}},
}

# NOTE: some flakiness here
# state_exclude is a set and does not preserve order
# when dumping to json it gets converted to a list
dynamic_sidecar_spec.TaskTemplate.ContainerSpec.Env[
"DY_SIDECAR_STATE_EXCLUDE"
] = sorted(
dynamic_sidecar_spec.TaskTemplate.ContainerSpec.Env[
"DY_SIDECAR_STATE_EXCLUDE"
]
)
expected_dynamic_sidecar_spec_model.TaskTemplate.ContainerSpec.Env[
"DY_SIDECAR_STATE_EXCLUDE"
] = sorted(
expected_dynamic_sidecar_spec_model.TaskTemplate.ContainerSpec.Env[
"DY_SIDECAR_STATE_EXCLUDE"
]
)

assert dynamic_sidecar_spec.dict(
exclude=exclude_keys
) == expected_dynamic_sidecar_spec_model.dict(exclude=exclude_keys)
Expand Down