mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-11 12:15:34 +08:00
Add signal tests for main (#685)
Added tests to validate the process receiving signals: - SIGTERM and SIGINT exit. - SIGUSR2 swaps logs Removed the empty Fprintln in main. Turns out stderr isn't thread safe to write from multiple locations. The logger, which is otherwise the only stderr writing goroutine creates a sync writer. But the stderr in main remains unsafe. This is something to fix later? There are also races happening with the swap log test, but only when the test runs in parallel. I'm not sure what's happening there... added a flag to make this test synchronous for now. Tests that depend on signals don't run on windows. That's a big todo. I moved SIGUSR2 behind build tags, so the binary will at least compile.
This commit is contained in:
@@ -4,5 +4,5 @@ package log
|
||||
|
||||
import "os"
|
||||
|
||||
// TODO(@groob) implement
|
||||
// TODO(issues/686) implement signals for windows
|
||||
var defaultSwapSignal = os.Signal(nil)
|
||||
|
||||
Reference in New Issue
Block a user