Skip to content

test(core): run oversized-input tests in a child process - #150

Merged
senrecep merged 1 commit into
mainfrom
test/core-oversized-input-child-process
Oct 10, 2026
Merged

senrecep merged 1 commit into
mainfrom
test/core-oversized-input-child-process

Conversation

@senrecep

Copy link
Copy Markdown
Owner

What / why

The ToSnakeCase (6M chars) and GetRandomItems (6M items) regression tests ran inside the test host, so a stack-overflow regression crashed the whole host. They now run in a child process (the test assembly re-invoked via dotnet <assembly> <scenario>; GenerateProgramFile=false plus a tiny Main that is only used for child runs, vstest never calls it). The test asserts exit code 0 and reports exit code/stderr on failure; 120s timeout kills the child.

Evidence

Red: library fix for #142 reverted locally (not committed, git checkout 2eddfba^ -- StringExtensions.cs RandomItemsExtensions.cs):

  • GetRandomItems_Should_Not_Overflow_The_Stack_When_Source_Is_Very_Large FAIL: "Scenario 'getrandomitems' exited with code 134. Stack overflow. at RandomItemsExtensions.GetRandomItems"
  • ToSnakeCase_Should_Not_Overflow_The_Stack_When_Input_Is_Very_Large FAIL: "Scenario 'tosnakecase' exited with code 134. Stack overflow. at StringExtensions.ConvertCase"
  • Test host stayed alive, run reported Failed: 2, Total: 2 in ~0.5s.

Green: fix restored, dotnet test -f net9.0 --filter FullyQualifiedName~Core: 2153 passed. Both tests ~0.3s each.

Behaviour change

None (tests only, no release).

Refs #146

🤖 Generated with Claude Code

The ToSnakeCase (6M chars) and GetRandomItems (6M items) tests ran in the
test host, so a stack-overflow regression killed the whole host instead of
failing one test. They now re-invoke the test assembly with a scenario name
in a child process and assert on exit code 0; a crash is reported as a test
failure with the child's exit code and stderr. No library behaviour change.

Refs #146

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@senrecep
senrecep merged commit a2dcb13 into main Oct 10, 2026
10 checks passed
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