Skip to content

Commit

Permalink
Fix changed functionality after refactoring testing for test_logging_…
Browse files Browse the repository at this point in the history
…setup and test_https_requests
  • Loading branch information
DanSava committed Dec 23, 2024
1 parent b13ad45 commit e4f8624
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tests/everest/test_detached.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
@pytest.mark.xdist_group(name="starts_everest")
async def test_https_requests(copy_math_func_test_data_to_tmp):
everest_config = EverestConfig.load_file("config_minimal.yml")
# Overwrite forward_model with model that actually does nothing, since we test for httprequests and server status
everest_config.forward_model = ["toggle_failure"]
everest_config.install_jobs = [
InstallJobConfig(name="toggle_failure", source="jobs/FAIL_SIMULATION")
]
Path("SLEEP_job").write_text("EXECUTABLE sleep", encoding="utf-8")
everest_config.forward_model.append("sleep 5")
everest_config.install_jobs.append(
InstallJobConfig(name="sleep", source="SLEEP_job")
)
# start_server() loads config based on config_path, so we need to actually overwrite it
everest_config.dump("config_minimal.yml")

Expand Down
9 changes: 7 additions & 2 deletions tests/everest/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def _string_exists_in_file(file_path, string):


@pytest.mark.flaky(reruns=5)
@pytest.mark.timeout(70) # Simulation might not finish
@pytest.mark.timeout(120) # Simulation might not finish
@pytest.mark.integration_test
@pytest.mark.xdist_group(name="starts_everest")
async def test_logging_setup(copy_math_func_test_data_to_tmp):
Expand All @@ -33,13 +33,18 @@ async def server_running():
everest_config.install_jobs.append(
InstallJobConfig(name="toggle_failure", source="jobs/FAIL_SIMULATION")
)
everest_config.optimization.min_pert_success = 1
everest_config.optimization.max_iterations = 1
everest_config.optimization.min_realizations_success = 1
everest_config.optimization.perturbation_num = 2

# start_server() loads config based on config_path, so we need to actually overwrite it
everest_config.dump("config_minimal.yml")

makedirs_if_needed(everest_config.output_dir, roll_if_exists=True)
driver = await start_server(everest_config, debug=True)
try:
wait_for_server(everest_config.output_dir, 60)
wait_for_server(everest_config.output_dir, 120)
except (SystemExit, RuntimeError) as e:
raise e
await server_running()
Expand Down

0 comments on commit e4f8624

Please sign in to comment.