Skip to content

Publish the stress tests; answer the ThreadJob and PoshRSJob question - #30

Merged
HalRiveria merged 3 commits into
mainfrom
docs/third-party-tests
Nov 2, 2026
Merged

HalRiveria merged 3 commits into
mainfrom
docs/third-party-tests

Conversation

@HalRiveria-Bot

@HalRiveria-Bot HalRiveria-Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

What was wrong

The FAQ said ThreadJob and PoshRSJob hadn't been tested for the scriptblock problem. They have been, and both are affected, but neither the answer nor the tests behind it were public. "Why Not Use X?" also said PoshRSJob had the same strengths and gaps as ThreadJob, which the tests don't support.

A docs pass also found a few smaller errors in the README, listed below.

What changed

  • README, FAQ and comparisons:
    • The FAQ now answers "Yes, both", cites PowerShell issue #12378, keeps the test details in a collapsed section, and links the test scripts and results.
    • The ForEach-Object -Parallel entry credits it for refusing a $using: scriptblock.
    • The PoshRSJob entry says it's hit harder than ThreadJob, can report Completed before its output is ready, and hasn't had a release since 2018.
    • The ThreadJob entry names its Gallery package.
    • The Testing section explains Testing/ and how to run the third-party matrix.
  • README, smaller fixes:
    • Unregister-PkCancellationSource is now mentioned; the FAQ's "everything else is internal" wasn't true without it.
    • "All four are safe in worker code" sat under a table of six functions, all of them safe.
    • The harness takes about two minutes, not one.
    • A missing blank line in the Abort section is fixed.
    • The FAQ no longer refers to an "original project" the page doesn't otherwise mention.
  • Testing/, new:
    • third-party/: the stress runner, plus results/matrix.log with one summary line per case (20 trials of 8 jobs, on 5.1 and 7, Microsoft.PowerShell.ThreadJob 2.2.0 and PoshRSJob 1.7.4.4).
    • cmdlet-hang/: the stress test for the kit's own worker code.
    • hosts/check-host.ps1: a check to run in a host you choose.

Raw per-run results and the downloaded modules aren't included.

Testing

Docs and standalone scripts only; ParallelKit.ps1 and the harness are unchanged, so I didn't rerun the harness locally.

Run on this machine:

  • The README's New-Item and Save-PSResource commands on PowerShell 7 (PSResourceGet 1.2.0), with -TrustRepository added because the run was non-interactive. Without it, Save-PSResource prompts. They saved the module versions above.
  • The full 48-case matrix, from those saved modules: matrix.log is that run.
    • Text-passing controls: 20 of 20 passed in all 16 cases.
    • A scriptblock job value: failed in 158 of 160 trials while the script was busy (2 passed on 5.1 ThreadJob). With ThreadJob it passed 20 of 20 when the script only waited in Wait-Job, and with PoshRSJob it never passed.
    • Delegates: PoshRSJob failed every trial. ThreadJob gave some wrong results while busy, and timed out, hung or crashed in every trial while waiting.
  • cmdlet-hang: no hangs in 3 trials on 5.1.
  • check-host.ps1 -NoCtrlC reached done on 5.1.
  • PowerShell 7.6.2: ForEach-Object -Parallel refuses a $using: scriptblock, and Start-ThreadJob still runs one.

Trial counts vary a little between runs, because these are races. Which cases fail doesn't.

🤖 Generated with Claude Code

HalRiveria and others added 3 commits November 2, 2026 11:57
The FAQ said ThreadJob and PoshRSJob hadn't been tested for the scriptblock
problem. They have, and both are affected. The FAQ now gives that answer and
links the test scripts and results, so the claim can be checked and rerun.
The Why Not Use X entries are updated to match: PoshRSJob no longer reads as
equivalent to ThreadJob, and ThreadJob names its Gallery package.

Testing/ adds the stress tests behind the README's claims: the third-party
matrix with its summary, the kit's own worker stress test, and the host
check. The README's Testing section says what each is for and how to run the
third-party matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urce comes from

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… small errors

Lead the ThreadJob and PoshRSJob answer with "Yes, both" and keep the test
details in a collapsed section. Credit ForEach-Object -Parallel for refusing
a $using: scriptblock. Mention Unregister-PkCancellationSource, correct the
harness run time and the worker-safety line under the single-process table.
matrix.log is a full run of the published scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HalRiveria
HalRiveria merged commit 14ffa7c into main Nov 2, 2026
2 checks passed
@HalRiveria
HalRiveria deleted the docs/third-party-tests branch November 2, 2026 18:39
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