#618: icons::USE_NERD_FONTS is unguarded process-global render state — one future test away from nondeterministic snapshot failures - #644
Merged
JDonaghy merged 1 commit intoAug 9, 2026
Conversation
…-global Icon::s()/c() read a process-wide AtomicBool to pick between the nerd glyph and ASCII fallback, and it's written from several production paths (tui_main, shell_app, settings :set nerdfonts, gtk). Since Rust's test harness runs tests concurrently across threads in one process, a single future test flipping this flag would nondeterministically corrupt every snapshot test running on another thread at the same time -- exactly the failure shape #615 turned out not to be, but which the #615 audit surfaced as a live landmine. Swap the AtomicBool for a thread_local Cell<bool>. Both backends only ever set-then-render on their own single thread, so this is behavior- preserving in production, while making cross-test corruption structurally impossible: a test that flips the flag can only affect other tests dispatched to the very same worker thread, never concurrently-running tests on other threads. Add regression tests proving the default-true behavior survives the swap and that setting the flag on one thread is invisible to a concurrently-running thread. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #618
Automated PR opened by coordinator for review of issue #618.