aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-11-20 01:38:12 +0900
committerOphestra <cat@gensokyo.uk>2026-11-20 01:46:04 +0900
commita6e5cfdf2e7a5b6620b1b2b0f770ce484d749be3 (patch)
treeae27b3f456c419af255bdce89f5c3bbbff956156
parent49ebd9d55c7555589a6b37eafa1d8fe9b5577e62 (diff)
internal/testsuite: fail on early instance termination
An early termination is not always caught by onDone. This could leave the test suite scanning forever if not handled. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/testsuite/testsuite.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go
index e6bc3a49..32d5e1ba 100644
--- a/internal/testsuite/testsuite.go
+++ b/internal/testsuite/testsuite.go
@@ -797,8 +797,13 @@ func StartHakurei(
processCommand(cmd)
}
+ var onDoneReached atomic.Bool
done := MustStart(cmd)
- wg.Go(func() { _err := <-done; onDone(_err, output.String()) })
+ wg.Go(func() {
+ _err := <-done
+ onDoneReached.Store(true)
+ onDone(_err, output.String())
+ })
if err = errors.Join(
_notify.Close(),
@@ -874,6 +879,13 @@ func StartHakurei(
var stat syscall.Stat_t
pid = MustScanFor(func() {
+ if onDoneReached.Load() {
+ log.Fatalf(
+ "%s terminated while scanning\n%s",
+ c.Container.Hostname,
+ output.String(),
+ )
+ }
log.Printf(
"still scanning for %s, output:\n%s",
c.Container.Hostname,