diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-13 19:17:19 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-13 19:17:19 +0900 |
| commit | e5ff40e7d32d28cace183cd2c80f40f142855ff5 (patch) | |
| tree | 734810d5988a0ba8d7548f407aa0f977ed32d68e /container/container_test.go | |
| parent | 123d7fbfd5a2955dc5042c0a85211e376d5a8e65 (diff) | |
container: synchronise after notify
This should eliminate intermittent failures in the forward test.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/container_test.go')
| -rw-r--r-- | container/container_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/container/container_test.go b/container/container_test.go index e692ab3c..11f398bb 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 {} }) |
