Skip to content

test(stl): isolate ThreadLocal key-exhaustion test in its own process - #5338

Merged
zackees merged 1 commit into
masterfrom
grind/5323-isolate-threadlocal-key-exhaustion-test
Nov 21, 2026
Merged

zackees merged 1 commit into
masterfrom
grind/5323-isolate-threadlocal-key-exhaustion-test

Conversation

@zackees

@zackees zackees commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Closes #5323

Moves the #5310 pthread key-exhaustion test into its own file, tests/fl/stl/thread_local_key_exhaustion.cpp, so it runs in a separate process and cannot starve other ThreadLocal tests of keys. Test body unchanged.

Verified: bash test thread_local_key_exhaustion (incl. --debug), bash test thread_local, bash lint, ./lint.

Summary by CodeRabbit

  • Tests
    • Added regression coverage for thread-local storage behavior when system thread-local keys are exhausted, including value initialization and access across threads.
    • The exhaustion test is now maintained separately from the existing thread-local tests.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

No actionable comments were generated in the recent review.

Walkthrough

The pthread-key-exhaustion regression test moved from thread_local.cpp to thread_local_key_exhaustion.cpp. The test checks ThreadLocal<int> default values and fallback-slot behavior across threads.

Changes: ThreadLocal test isolation

Layer / File(s) Summary
Move the key-exhaustion test
tests/fl/stl/thread_local.cpp, tests/fl/stl/thread_local_key_exhaustion.cpp
The test was removed from the shared ThreadLocal test file and added to a dedicated file. It checks default values and fallback-slot reads and updates across threads after pthread-key exhaustion.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Possibly related issues

  • #5335 — The tracking issue lists the test-isolation follow-up addressed by this change.

Possibly related PRs

Merge Risk: Minimal · up to be322

This is a test-only change that isolates the pthread-key-exhaustion test so it cannot affect other ThreadLocal tests. It has no production impact, and I found no merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test(stl): isolate ThreadLocal key-exhaustion test in its own process" matches the main change. The PR moves the pthread key-exhaustion test out of thread_local.cpp into thread_local_key_ex…
Linked Issues check Passed Issue #5323 asks that the key-exhaustion test run in its own process or otherwise be isolated. At head, tests/fl/stl/thread_local.cpp no longer contains the key-exhaustion test. It has only a comment …
Out of Scope Changes check Passed The changes are limited to tests/fl/stl/thread_local.cpp (removal of the key-exhaustion test) and the new file tests/fl/stl/thread_local_key_exhaustion.cpp. Both changes directly implement the isolati…
Full details: Title check

Explanation

The title "test(stl): isolate ThreadLocal key-exhaustion test in its own process" matches the main change. The PR moves the pthread key-exhaustion test out of thread_local.cpp into thread_local_key_exhaustion.cpp so it runs in a separate process. The raw summary confirms the removal from thread_local.cpp and the addition of the new file. The title is specific, uses a conventional prefix, and aligns with linked issue #5323.

Full details: Linked Issues check

Explanation

Issue #5323 asks that the key-exhaustion test run in its own process or otherwise be isolated. At head, tests/fl/stl/thread_local.cpp no longer contains the key-exhaustion test. It has only a comment pointing to thread_local_key_exhaustion.cpp. The new file holds the test case with the same logic: it hoards pthread keys, constructs ThreadLocal<int> with and without a default, then checks the fallback-slot values across a second thread. The new file's comment states that each tests/**/*.cpp runs as its own process. That harness behavior is the basis for the isolation. I did not independently read the test runner to confirm it. The base-side diff could not be read, so I could not compare the test body line by line against the base revision. The head content matches the PR description's claim that the body is unchanged.

Full details: Out of Scope Changes check

Explanation

The changes are limited to tests/fl/stl/thread_local.cpp (removal of the key-exhaustion test) and the new file tests/fl/stl/thread_local_key_exhaustion.cpp. Both changes directly implement the isolation objective of #5323. No production code or unrelated test is changed in the reviewed evidence. The base-side diff was unavailable, so this verdict relies on the head file contents and the PR summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b248352 and be322df.

Files selected for processing: 2

  • tests/fl/stl/thread_local.cpp
  • tests/fl/stl/thread_local_key_exhaustion.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@github-actions github-actions Bot added the sanitized Title, body and conversation screened; review text requires separate screening. label Nov 21, 2026
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 21, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 21, 2026
@github-actions github-actions Bot added sanitized Title, body and conversation screened; review text requires separate screening. and removed sanitized Title, body and conversation screened; review text requires separate screening. labels Nov 21, 2026
@zackees
zackees added this pull request to the merge queue Nov 21, 2026
Merged via the queue into master with commit 972deaa Nov 21, 2026
130 checks passed
@zackees
zackees deleted the grind/5323-isolate-threadlocal-key-exhaustion-test branch November 21, 2026 06:17
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sanitized Title, body and conversation screened; review text requires separate screening.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test(stl): isolate ThreadLocal key-exhaustion test in its own process (follow-up #5310)

1 participant