Skip to content

Pass the worker to the build factory#695

Open
encukou wants to merge 1 commit intopython:mainfrom
encukou:config-cleanup-pass-worker
Open

Pass the worker to the build factory#695
encukou wants to merge 1 commit intopython:mainfrom
encukou:config-cleanup-pass-worker

Conversation

@encukou
Copy link
Copy Markdown
Member

@encukou encukou commented Mar 31, 2026

We used to pluck the following attributes from CPythonWorker, our "dataclass-ish" config object, and pass them to builds:

  • parallel_tests (via lookup in parallel, a global dict)
  • timeout_factor (via extra_factory_args)
  • exclude_test_resources (via extra_factory_args)

Instead, pass in the whole CPythonWorker.

Also: Simplify if/else logic for adding the -j option, with a helper that can return an empty list.

Also: Remove "-j2" from class-level testFlags: it always matched the default or was overridden.

We used to pluck the following attributes from our "dataclass-ish"
CPythonWorker and pass them as separate arguments:
- parallel_tests (via lookup in `parallel`, a global dict)
- timeout_factor (via `extra_factory_args`)
- exclude_test_resources (via `extra_factory_args`)

Just pass the whole CPythonWorker in.

Also: Simplify if/else logic for adding the -j option, with
a helper that can return an empty list.

Also: Remove "-j2" from class-level testFlags: it always matched
the default or was overridden.
@encukou encukou requested a review from zware March 31, 2026 08:50
@encukou
Copy link
Copy Markdown
Member Author

encukou commented Mar 31, 2026

@zware, this is where I got from dfac4f3. It doesn't rename parallel/parallel_tests to parallel_processes (yet). A rename would conflict with worker config changes, making things e.g. harder to revert, so it's better to do as a separate PR after some time (if at all).

Copy link
Copy Markdown
Member

@zware zware left a comment

Choose a reason for hiding this comment

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

LGTM :)

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.

2 participants