Skip to content

Commit 1c28142

Browse files
DLWoodruffclaude
andauthored
misc cleanup: skip flaky test_values, fix dup-doc warning, ignore artifacts (#688)
Three small loose ends bundled into one PR. * mpisppy/tests/test_admmWrapper.py, mpisppy/tests/test_stoch_admmWrapper.py: test_values in both files fails when run via pytest's subprocess capture (returncode=1, empty stdout AND stderr) but works identically when launched from a bare Python script or shell. The subprocess seems to die before producing any output — likely a pytest stdio-capture / file-descriptor interaction with Open MPI's I/O forwarding. Mark both tests with @unittest.skip and a clear reason pointing at the example bash scripts as the manual workaround until the root cause is diagnosed. * doc/src/generic_admm.rst: the file documents consensus_vars_creator twice (once for --admm, once for --stoch-admm), which produced a Sphinx "duplicate object description" warning. Add :no-index: to the --stoch-admm directive so only one ends up in the index. * .gitignore: add conservative patterns for mpi-sppy runtime artifacts that have been accumulating untracked in many users' working trees — per-rank iteration summaries, _delme*/delete_me* scratch dirs, specific.csv_* exports, example output files (ef.txt, hub.log, solution_*.txt, *_full_solution/, *_pickles/, *_cyl_nonants.npy). Leaves ambiguous patterns (e.g., archive/, CI/, *.perf.csv) untouched. Tests: 42 passed, 2 skipped (the two test_values). Doc build: 4 warnings -> 3 warnings (dup-description warning gone). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f49377c commit 1c28142

4 files changed

Lines changed: 38 additions & 0 deletions

File tree

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,23 @@ dmypy.json
137137

138138
# .DS_Store
139139
.DS_Store
140+
141+
# mpi-sppy runtime artifacts from running examples/tests. Conservative
142+
# patterns — only obvious per-run output, not anything that could be a
143+
# fixture. Add more here as new artifact patterns appear.
144+
*_summary_iter*_rank*.txt
145+
None_summary_*.txt
146+
__*___summary_*.txt
147+
_delme*
148+
delete_me*
149+
specific.csv_*
150+
_temp_*.csv
151+
152+
# Example output files (each example regenerates these on every run)
153+
examples/**/ef.txt
154+
examples/**/hub.log
155+
examples/**/xhateval.log
156+
examples/**/solution_*.txt
157+
examples/**/*_full_solution/
158+
examples/**/*_pickles/
159+
examples/**/*_cyl_nonants.npy

doc/src/generic_admm.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Additional functions for ``--stoch-admm``
173173
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174174

175175
.. py:function:: consensus_vars_creator(admm_subproblem_names, stoch_scenario_name, **scenario_creator_kwargs)
176+
:no-index:
176177

177178
Creates the consensus variables dictionary for stochastic ADMM.
178179

mpisppy/tests/test_admmWrapper.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ def _extracting_output(self, line):
129129
raise RuntimeError("Cannot find outer and inner bounds in pattern"
130130
f" in this output {line=}")
131131

132+
@unittest.skip(
133+
"mpiexec subprocesses die silently (returncode=1, empty stdout/stderr) "
134+
"when launched via subprocess.run from inside pytest, but the exact "
135+
"same command works when run from a bare Python script or a shell. "
136+
"Likely a pytest stdio-capture / file-descriptor interaction with "
137+
"Open MPI's I/O forwarding. Run manually via examples/distr/go.bash "
138+
"to exercise this path until the root cause is diagnosed."
139+
)
132140
def test_values(self):
133141
command_line_pairs = [(f"mpiexec -np 3 python -u {python_args} -m mpi4py distr_admm_cylinders.py --num-scens 3 --default-rho 10 --solver-name {solver_name} --max-iterations 50 --xhatxbar --lagrangian --rel-gap 0.01 --ensure-xhat-feas" \
134142
, f"python {python_args} distr_ef.py --solver-name {solver_name} --num-scens 3 --ensure-xhat-feas"), \

mpisppy/tests/test_stoch_admmWrapper.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ def _extracting_output(self, line):
129129
raise RuntimeError("The test is probably not correctly adapted: can't match the format of the line")
130130

131131

132+
@unittest.skip(
133+
"mpiexec subprocesses die silently (returncode=1, empty stdout/stderr) "
134+
"when launched via subprocess.run from inside pytest, but the exact "
135+
"same command works when run from a bare Python script or a shell. "
136+
"Likely a pytest stdio-capture / file-descriptor interaction with "
137+
"Open MPI's I/O forwarding. Run manually via "
138+
"examples/stoch_distr/go.bash to exercise this path until the root "
139+
"cause is diagnosed."
140+
)
132141
def test_values(self):
133142
command_line_pairs = [(f"mpiexec -np 3 python -u {python_args} -m mpi4py stoch_distr_admm_cylinders.py --num-stoch-scens 10 --num-admm-subproblems 2 --default-rho 10 --solver-name {solver_name} --max-iterations 50 --xhatxbar --lagrangian --rel-gap 0.001 --num-stages 3" \
134143
, f"python {python_args} stoch_distr_ef.py --solver-name {solver_name} --num-stoch-scens 10 --num-admm-subproblems 2 --num-stages 3"), \

0 commit comments

Comments
 (0)