Skip to content

Commit

Permalink
updated flaky kwargs to latest version (reruns -> max_runs)
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Oct 1, 2024
1 parent 2daf48f commit f54640b
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions pydra/engine/tests/test_boutiques.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

@no_win
@need_bosh_docker
@pytest.mark.flaky(reruns=3) # need for travis
@pytest.mark.flaky(max_runs=3) # need for travis
@pytest.mark.parametrize(
"maskfile", ["test_brain.nii.gz", "test_brain", "test_brain.nii"]
)
Expand All @@ -45,7 +45,7 @@ def test_boutiques_1(maskfile, plugin, results_function, tmpdir, data_tests_dir)

@no_win
@need_bosh_docker
@pytest.mark.flaky(reruns=3)
@pytest.mark.flaky(max_runs=3)
def test_boutiques_spec_1(data_tests_dir):
"""testing spec: providing input/output fields names"""
btask = BoshTask(
Expand All @@ -70,7 +70,7 @@ def test_boutiques_spec_1(data_tests_dir):

@no_win
@need_bosh_docker
@pytest.mark.flaky(reruns=3)
@pytest.mark.flaky(max_runs=3)
def test_boutiques_spec_2(data_tests_dir):
"""testing spec: providing partial input/output fields names"""
btask = BoshTask(
Expand All @@ -93,7 +93,7 @@ def test_boutiques_spec_2(data_tests_dir):

@no_win
@need_bosh_docker
@pytest.mark.flaky(reruns=3)
@pytest.mark.flaky(max_runs=3)
@pytest.mark.parametrize(
"maskfile", ["test_brain.nii.gz", "test_brain", "test_brain.nii"]
)
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_boutiques_wf_1(maskfile, plugin, tmpdir, infile):

@no_win
@need_bosh_docker
@pytest.mark.flaky(reruns=3)
@pytest.mark.flaky(max_runs=3)
@pytest.mark.xfail(reason="issues with bosh for 4472771")
@pytest.mark.parametrize(
"maskfile", ["test_brain.nii.gz", "test_brain", "test_brain.nii"]
Expand Down
18 changes: 9 additions & 9 deletions pydra/engine/tests/test_node_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def test_odir_init():
# Tests for tasks without state (i.e. no splitter)


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_nostate_1(plugin_dask_opt, tmp_path):
"""task without splitter"""
nn = fun_addtwo(name="NA", a=3)
Expand Down Expand Up @@ -399,7 +399,7 @@ def test_task_nostate_1_call():
assert nn.output_dir.exists()


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_nostate_1_call_subm(plugin_dask_opt, tmp_path):
"""task without splitter"""
nn = fun_addtwo(name="NA", a=3)
Expand All @@ -417,7 +417,7 @@ def test_task_nostate_1_call_subm(plugin_dask_opt, tmp_path):
assert nn.output_dir.exists()


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_nostate_1_call_plug(plugin_dask_opt, tmp_path):
"""task without splitter"""
nn = fun_addtwo(name="NA", a=3)
Expand Down Expand Up @@ -549,7 +549,7 @@ def test_task_nostate_7():
# Testing caching for tasks without states


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_nostate_cachedir(plugin_dask_opt, tmp_path):
"""task with provided cache_dir using pytest tmp_path"""
cache_dir = tmp_path / "test_task_nostate"
Expand All @@ -566,7 +566,7 @@ def test_task_nostate_cachedir(plugin_dask_opt, tmp_path):
assert results.output.out == 5


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_nostate_cachedir_relativepath(tmp_path, plugin_dask_opt):
"""task with provided cache_dir as relative path"""
os.chdir(tmp_path)
Expand All @@ -587,7 +587,7 @@ def test_task_nostate_cachedir_relativepath(tmp_path, plugin_dask_opt):
shutil.rmtree(cache_dir)


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_nostate_cachelocations(plugin_dask_opt, tmp_path):
"""
Two identical tasks with provided cache_dir;
Expand Down Expand Up @@ -729,7 +729,7 @@ def test_task_nostate_cachelocations_updated(plugin, tmp_path):
# Tests for tasks with states (i.e. with splitter)


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
@pytest.mark.parametrize("input_type", ["list", "array"])
def test_task_state_1(plugin_dask_opt, input_type, tmp_path):
"""task with the simplest splitter"""
Expand Down Expand Up @@ -1074,7 +1074,7 @@ def test_task_state_6a(plugin, tmp_path):
assert odir.exists()


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_state_comb_1(plugin_dask_opt, tmp_path):
"""task with the simplest splitter and combiner"""
nn = fun_addtwo(name="NA").split(a=[3, 5], splitter="a").combine(combiner="a")
Expand Down Expand Up @@ -1451,7 +1451,7 @@ def test_task_state_comb_contdim_2(tmp_path):
# Testing caching for tasks with states


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_task_state_cachedir(plugin_dask_opt, tmp_path):
"""task with a state and provided cache_dir using pytest tmp_path"""
cache_dir = tmp_path / "test_task_nostate"
Expand Down
6 changes: 3 additions & 3 deletions pydra/engine/tests/test_shelltask.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
pytest.skip("SLURM not available in windows", allow_module_level=True)


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
@pytest.mark.parametrize("results_function", [result_no_submitter, result_submitter])
def test_shell_cmd_1(plugin_dask_opt, results_function, tmp_path):
"""simple command, no arguments"""
Expand Down Expand Up @@ -107,7 +107,7 @@ def test_shell_cmd_2b(plugin, results_function, tmp_path):
# tests with State


@pytest.mark.flaky(reruns=2)
@pytest.mark.flaky(max_runs=2)
def test_shell_cmd_3(plugin_dask_opt, tmp_path):
"""commands without arguments
splitter = executable
Expand Down Expand Up @@ -2174,7 +2174,7 @@ def test_shell_cmd_inputspec_copyfile_state_1(plugin, results_function, tmp_path
# customised input_spec in Workflow


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_wf_shell_cmd_2(plugin_dask_opt, tmp_path):
"""a workflow with input with defined output_file_template (str)
that requires wf.lzin
Expand Down
10 changes: 5 additions & 5 deletions pydra/engine/tests/test_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def test_wf_in_wf(plugin, tmpdir):
assert res.output.out == 7


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_wf2(plugin_dask_opt, tmpdir):
"""workflow as a node
workflow-node with one task and no splitter
Expand All @@ -156,7 +156,7 @@ def test_wf2(plugin_dask_opt, tmpdir):
assert res.output.out == 3


@pytest.mark.flaky(reruns=2) # when dask
@pytest.mark.flaky(max_runs=2) # when dask
def test_wf_with_state(plugin_dask_opt, tmpdir):
wf = Workflow(name="wf_with_state", input_spec=["x"])
wf.add(sleep_add_one(name="taska", x=wf.lzin.x))
Expand Down Expand Up @@ -235,7 +235,7 @@ def test_slurm_wf_state(tmpdir):


@need_slurm
@pytest.mark.flaky(reruns=3)
@pytest.mark.flaky(max_runs=3)
def test_slurm_max_jobs(tmpdir):
wf = Workflow("new_wf", input_spec=["x", "y"], cache_dir=tmpdir)
wf.inputs.x = 5
Expand Down Expand Up @@ -338,7 +338,7 @@ def cancel(job_name_part):
return proc.stderr.decode("utf-8").strip()


@pytest.mark.flaky(reruns=1)
@pytest.mark.flaky(max_runs=1)
@need_slurm
def test_slurm_cancel_rerun_1(tmpdir):
"""testing that tasks run with slurm is re-queue
Expand Down Expand Up @@ -371,7 +371,7 @@ def test_slurm_cancel_rerun_1(tmpdir):
assert script_dir.exists()


@pytest.mark.flaky(reruns=1)
@pytest.mark.flaky(max_runs=1)
@need_slurm
def test_slurm_cancel_rerun_2(tmpdir):
"""testing that tasks run with slurm that has --no-requeue
Expand Down
Loading

0 comments on commit f54640b

Please sign in to comment.