Skip to content

test: skip mock IPC tests on CRAN and fix mock server races - #76

Merged
eitsupi merged 2 commits into
mainfrom
fix/mock-server-cran-race
Oct 6, 2026
Merged

eitsupi merged 2 commits into
mainfrom
fix/mock-server-cran-race

Conversation

@eitsupi

@eitsupi eitsupi commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

CRAN's MKL check exposed a race in the mock test server: the Unix socket path can appear before the server is listening. A refused connection leaves the subprocess waiting, and the old collector then compares a NULL exit status with zero, producing a secondary error.

Skip subprocess/socket integration tests on CRAN at the shared local and TCP mock-server entry points, including direct callers. Publish local readiness only after socket creation and a zero-timeout poll starts connection waiting. On Windows, this registers ConnectNamedPipe before a fast client can connect and close, avoiding ERROR_NO_DATA during the first blocking poll. Share collection logic that terminates timed-out subprocesses and distinguishes unknown, nonzero, and successful exit statuses. Manage temporary paths in the caller's scope with withr.

The existing R check workflow sets NOT_CRAN=true, so integration tests continue to run in CI. No production transport, package version, or E2E workflow changes are needed.

Validation:

  • All six PR CI jobs passed: R CMD check on Ubuntu (R devel and 4.1), Windows (R 4.1), and macOS (R release), plus E2E on Ubuntu and Windows.
  • Windows i386 and x64 each passed 226 expectations with no failures or warnings; R CMD check reported Status: OK.
  • Local regression and frame-output tests passed 56 expectations with no failures, warnings, or skips, including delayed socket construction, delayed blocking polling, immediate client close, and automatic cleanup.
  • CRAN-mode full suite passed with 58 expectations and 74 skips; replacing callr::r_bg with an error confirmed that no mock subprocess was started. The follow-up CRAN regression/frame-output run also passed without subprocess calls.
  • Local R CMD check --no-manual --as-cran: no errors or warnings; one NOTE about this environment's compilation flags. R syntax and git diff --check passed.

Fixes #75

@eitsupi eitsupi changed the title Skip mock IPC tests on CRAN and fix mock server races test: skip mock IPC tests on CRAN and fix mock server races Oct 4, 2026
@eitsupi eitsupi mentioned this pull request Oct 4, 2026
@eitsupi
eitsupi merged commit 342d7b3 into main Oct 6, 2026
6 checks passed
@grantmcdermott

Copy link
Copy Markdown
Collaborator

Thanks for this @eitsupi. I've been slammed at work and just coming up for air.

We need to submit this patch for CRAN. Is there anything else that you'd like to roll into a 0.2.1 release? (I'll open a separate submission issue later today.)

@eitsupi
eitsupi deleted the fix/mock-server-cran-race branch October 6, 2026 15:20
@eitsupi

eitsupi commented Oct 6, 2026

Copy link
Copy Markdown
Member Author

Thank you. I don't have anything in particular to add.

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.

CRAN error (MKL)

2 participants