aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/testsuite/testsuite.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/internal/testsuite/testsuite.go b/internal/testsuite/testsuite.go
index 6e48eca1..2c82e1e9 100644
--- a/internal/testsuite/testsuite.go
+++ b/internal/testsuite/testsuite.go
@@ -17,10 +17,17 @@ import (
"strconv"
"strings"
"sync"
+ "sync/atomic"
"syscall"
"time"
)
+// serial is the next value returned by [NewSerial].
+var serial atomic.Uint64
+
+// NewSerial returns a serial number.
+func NewSerial() uint64 { defer serial.Add(1); return serial.Load() }
+
// ReceiveSignals blocks until a termination signal arrives, and terminates.
func ReceiveSignals() {
s := make(chan os.Signal, 3)
@@ -116,7 +123,7 @@ func MustStart(cmd *exec.Cmd) (done <-chan error) {
if err := cmd.Start(); err != nil {
log.Fatal(err)
}
- d := make(chan error)
+ d := make(chan error, 1)
go func() { d <- cmd.Wait() }()
return d
}