Skip to content

Let the inline test client say it is a local run, because it is one - #652

Merged
wshlavacek merged 1 commit into
mainfrom
test/faithful-fakeclient-local-run
Aug 24, 2026
Merged

Let the inline test client say it is a local run, because it is one#652
wshlavacek merged 1 commit into
mainfrom
test/faithful-fakeclient-local-run

Conversation

@wshlavacek

Copy link
Copy Markdown
Collaborator

FakeClient in the integration harness runs every submitted callable inline, so it stands in for a local run. It did not set the attribute that says so.

_report_parallelism tells a local run from a cluster run by whether the client owns a cluster object, because a real local Client drives a LocalCluster and a cluster client connects to a scheduler and owns nothing. The double set no such attribute, so it presented itself as a cluster run, and then failed the scheduler_info() call that claim leads to.

Nothing breaks. The failure is caught and the fit is unaffected. What it costs is attention. The handler records a full traceback, and pytest shows a captured log only for a test that fails, so the traceback turns up in exactly the situation where someone is reading a log to find out why something broke, attached to a fit that broke for an unrelated reason. It came up while diagnosing #648 and had to be ruled out before the real cause could be found.

Test only, one attribute. It just has to be present; nothing reads through it.

Checked on test_run_loop.py, test_wall_time_fit.py and test_cluster.py: 305 passed, 3 skipped, and the traceback is gone from a failing test's captured log.

FakeClient in the integration harness runs every submitted callable inline, so it
stands in for a local run. It did not set the attribute that says so.

_report_parallelism tells a local run from a cluster run by whether the client
owns a cluster object, because a real local Client drives a LocalCluster and a
cluster client connects to a scheduler and owns nothing. The double set no such
attribute, so it presented itself as a cluster run, and then failed the call that
claim leads to.

Nothing breaks. The failure is caught and the fit is unaffected. What it costs is
attention. The handler records a full traceback, and pytest shows a captured log
only for a test that fails, so the traceback turns up in exactly the situation
where someone is reading a log to find out why something broke, attached to a fit
that broke for an unrelated reason. It came up while diagnosing #648 and had to
be ruled out before the real cause could be found.

Test only. The attribute just has to be present; nothing reads through it.
@wshlavacek
wshlavacek merged commit 2044101 into main Aug 24, 2026
7 checks passed
@wshlavacek
wshlavacek deleted the test/faithful-fakeclient-local-run branch August 24, 2026 02:10
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.

1 participant