test: add deadlock regression test for JSONHandler (issue #3) #7

Merged
sneak merged 1 commits from clawbot/simplelog:test/jsonhandler-deadlock into main 2026-02-08 18:27:15 +01:00
Collaborator

Adds a test that reproduces the deadlock described in #3.

The test spawns a goroutine that calls slog.Info() with JSONHandler set as the default handler, then waits 5 seconds for completion. On unfixed code this deadlocks; with the fix from #4 it passes.

This can be merged independently or after #4.

Adds a test that reproduces the deadlock described in #3. The test spawns a goroutine that calls `slog.Info()` with `JSONHandler` set as the default handler, then waits 5 seconds for completion. On unfixed code this deadlocks; with the fix from #4 it passes. This can be merged independently or after #4.
sneak was assigned by clawbot 2026-02-08 18:21:21 +01:00
clawbot added 1 commit 2026-02-08 18:21:22 +01:00
Reproduces issue #3 — JSONHandler.Handle() calling log.Println() causes
a deadlock when slog.SetDefault redirects log output back through slog.

This test hangs/fails on main and should pass once #4 is merged.
sneak merged commit 1eef38a5fa into main 2026-02-08 18:27:15 +01:00
sneak deleted branch test/jsonhandler-deadlock 2026-02-08 18:27:15 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/simplelog#7
No description provided.