Skip to content

Commit

Permalink
[docker] improve test time (#7589)
Browse files Browse the repository at this point in the history
the step health check test was taking 10+ minutes to fail in buildkite, likely due to timouts / retries in the scheme of causing failure via not connecting the db network. 

change scheme to explicitly segfault. 

## Test Plan

bk
  • Loading branch information
alangenfeld committed Apr 28, 2022
1 parent 9345ebc commit aa37ece
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,16 @@ def docker_mode_defs():
]


@solid(input_defs=[InputDefinition("word", String)], config_schema={"factor": IntSource})
@solid(
input_defs=[InputDefinition("word", String)],
config_schema={
"factor": IntSource,
"should_segfault": Field(bool, is_required=False, default_value=False),
},
)
def multiply_the_word(context, word):
if context.solid_config.get("should_segfault"):
segfault()
return word * context.solid_config["factor"]


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ def test_docker_executor():


def test_docker_executor_check_step_health():
# missing network causes step to fail

executor_config = {
"execution": {
"docker": {
"config": {
"networks": ["container:test-postgres-db-docker"],
"env_vars": [
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
Expand Down Expand Up @@ -98,6 +97,9 @@ def test_docker_executor_check_step_health():
executor_config,
)

# force a segfault to terminate the container unexpectedly, step health check should then fail the step
run_config["solids"]["multiply_the_word"]["config"]["should_segfault"] = True

with environ({"DOCKER_LAUNCHER_NETWORK": "container:test-postgres-db-docker"}):
with docker_postgres_instance() as instance:
recon_pipeline = get_test_project_recon_pipeline("demo_pipeline_docker", docker_image)
Expand Down

0 comments on commit aa37ece

Please sign in to comment.