Skip to content

Commit 9c2a8da

Browse files
committed
add test
1 parent cb6ef02 commit 9c2a8da

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

nipype/pipeline/plugins/tests/test_multiproc.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,23 @@ def test_no_more_threads_than_specified(tmpdir):
115115
with pytest.raises(RuntimeError):
116116
pipe.run(plugin='MultiProc',
117117
plugin_args={'n_procs': max_threads})
118+
119+
120+
def test_hold_job_until_procs_available(tmpdir):
121+
tmpdir.chdir()
122+
123+
pipe = pe.Workflow(name='pipe')
124+
n1 = pe.Node(SingleNodeTestInterface(), name='n1', n_procs=2)
125+
n2 = pe.Node(SingleNodeTestInterface(), name='n2', n_procs=2)
126+
n3 = pe.Node(SingleNodeTestInterface(), name='n3', n_procs=2)
127+
n4 = pe.Node(SingleNodeTestInterface(), name='n4', n_procs=2)
128+
129+
pipe.connect(n1, 'output1', n2, 'input1')
130+
pipe.connect(n1, 'output1', n3, 'input1')
131+
pipe.connect(n2, 'output1', n4, 'input1')
132+
pipe.connect(n3, 'output1', n4, 'input2')
133+
n1.inputs.input1 = 4
134+
135+
max_threads = 2
136+
pipe.run(plugin='MultiProc',
137+
plugin_args={'n_procs': max_threads})

0 commit comments

Comments
 (0)