From e5ff40e7d32d28cace183cd2c80f40f142855ff5 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 13 Oct 2025 19:17:19 +0900 Subject: [PATCH] container: synchronise after notify This should eliminate intermittent failures in the forward test. Signed-off-by: Ophestra --- container/container_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/container/container_test.go b/container/container_test.go index e692ab3..11f398b 100644 --- a/container/container_test.go +++ b/container/container_test.go @@ -576,14 +576,13 @@ const ( func init() { helperCommands = append(helperCommands, func(c command.Command) { c.Command("block", command.UsageInternal, func(args []string) error { + sig := make(chan os.Signal, 1) + signal.Notify(sig, os.Interrupt) + go func() { <-sig; os.Exit(blockExitCodeInterrupt) }() + if _, err := os.NewFile(3, "sync").Write([]byte{0}); err != nil { return fmt.Errorf("write to sync pipe: %v", err) } - { - sig := make(chan os.Signal, 1) - signal.Notify(sig, os.Interrupt) - go func() { <-sig; os.Exit(blockExitCodeInterrupt) }() - } select {} })