Skip to content

Make PID status test deterministic (resolves #5232) - #5565

Open
w3lld1 wants to merge 1 commit into
DataBiosphere:masterfrom
w3lld1:issues/5232-fix-pid-status-flake
Open

Make PID status test deterministic (resolves #5232)#5565
w3lld1 wants to merge 1 commit into
DataBiosphere:masterfrom
w3lld1:issues/5232-fix-pid-status-flake

Conversation

@w3lld1

@w3lld1 w3lld1 commented Aug 13, 2026

Copy link
Copy Markdown

Changelog Entry

To be copied to the draft changelog by merger:

Summary

I changed testGetPIDStatus to launch a workflow that waits for an explicit release file. This keeps the leader process alive until the test has observed the RUNNING state, then lets the workflow finish so the existing COMPLETED and missing-PID checks still run.

This removes the timing dependency on the small sort workflow finishing before an overloaded CI runner polls its status.

Validation

  • python -m pytest src/toil/test/utils/utilsTest.py::TestUtils::testGetPIDStatus -q (20 consecutive runs, plus a post-commit run)
  • python -m pytest src/toil/test/utils/utilsTest.py -q (8 passed, 4 dependency/integration skips)
  • Black check on the changed file
  • Isort check on the changed file
  • Repository-configured Flake8 check on the changed file
  • git diff --check

The complete repository test suite is deferred to CI.

Fixes #5232

@adamnovak adamnovak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK, and I think will indeed fix the bug, but it could be laid out a little better.

Comment on lines +403 to +411
workflow = """
from toil.job import Job
from toil.test.utils.utilsTest import wait_for_file
import sys

options = Job.Runner.getDefaultOptions(sys.argv[1])
options.clean = "never"
Job.Runner.startToil(Job.wrapFn(wait_for_file, sys.argv[2]), options)
"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better for this to be its own Python file and not an inline string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get PID test is flaky

2 participants