aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-17 17:02:36 +0900
committerOphestra <cat@gensokyo.uk>2026-03-17 17:04:06 +0900
commit420c721c7da46ab1c633b019441b7b623215fd12 (patch)
tree8443996fcee8a5df3427708ecdd353fba54f941b
parentbac583f89edd1360150143ff51f7264c01aa69ec (diff)
all: raise timeout defaults
This avoids timing out on systems running very slowly. Signed-off-by: Ophestra <cat@gensokyo.uk>
-rw-r--r--internal/dbus/dbus_test.go4
-rw-r--r--internal/helper/helper.go2
-rw-r--r--internal/helper/helper_test.go2
-rw-r--r--internal/helper/proc/files.go2
-rw-r--r--internal/info/version.go1
-rw-r--r--internal/outcome/shim.go2
-rw-r--r--internal/pipewire/core.go2
-rw-r--r--internal/pipewire/pipewire.go8
-rw-r--r--internal/pipewire/pipewire_test.go2
-rw-r--r--internal/system/pipewire_test.go2
-rw-r--r--ldd/exec.go5
11 files changed, 17 insertions, 15 deletions
diff --git a/internal/dbus/dbus_test.go b/internal/dbus/dbus_test.go
index 5d6e4c40..f6175567 100644
--- a/internal/dbus/dbus_test.go
+++ b/internal/dbus/dbus_test.go
@@ -65,13 +65,13 @@ func TestProxyStartWaitCloseString(t *testing.T) {
}
const (
- stubProxyTimeout = 5 * time.Second
+ stubProxyTimeout = 15 * time.Second
)
func testProxyFinaliseStartWaitCloseString(t *testing.T, useSandbox bool) {
{
oldWaitDelay := helper.WaitDelay
- helper.WaitDelay = 16 * time.Second
+ helper.WaitDelay = 30 * time.Second
t.Cleanup(func() { helper.WaitDelay = oldWaitDelay })
}
diff --git a/internal/helper/helper.go b/internal/helper/helper.go
index 378d9471..c16ff366 100644
--- a/internal/helper/helper.go
+++ b/internal/helper/helper.go
@@ -11,7 +11,7 @@ import (
"hakurei.app/internal/helper/proc"
)
-var WaitDelay = 2 * time.Second
+var WaitDelay = 5 * time.Second
const (
// HakureiHelper is set to 1 when args fd is enabled and 0 otherwise.
diff --git a/internal/helper/helper_test.go b/internal/helper/helper_test.go
index dae098b8..a44d5ede 100644
--- a/internal/helper/helper_test.go
+++ b/internal/helper/helper_test.go
@@ -56,7 +56,7 @@ const (
// this function tests an implementation of the helper.Helper interface
func testHelper(t *testing.T, createHelper func(ctx context.Context, setOutput func(stdoutP, stderrP *io.Writer), stat bool) helper.Helper) {
oldWaitDelay := helper.WaitDelay
- helper.WaitDelay = 16 * time.Second
+ helper.WaitDelay = 30 * time.Second
t.Cleanup(func() { helper.WaitDelay = oldWaitDelay })
t.Run("start helper with status channel and wait", func(t *testing.T) {
diff --git a/internal/helper/proc/files.go b/internal/helper/proc/files.go
index 0612718e..10a3c0c4 100644
--- a/internal/helper/proc/files.go
+++ b/internal/helper/proc/files.go
@@ -10,7 +10,7 @@ import (
"time"
)
-var FulfillmentTimeout = 2 * time.Second
+var FulfillmentTimeout = 15 * time.Second
func init() {
if testing.Testing() {
diff --git a/internal/info/version.go b/internal/info/version.go
index 8e722f78..5e3e6aac 100644
--- a/internal/info/version.go
+++ b/internal/info/version.go
@@ -1,3 +1,4 @@
+// Package info holds metadata populated at link time.
package info
// FallbackVersion is returned when a version string was not set by the linker.
diff --git a/internal/outcome/shim.go b/internal/outcome/shim.go
index 6f509e14..d2706c8b 100644
--- a/internal/outcome/shim.go
+++ b/internal/outcome/shim.go
@@ -147,7 +147,7 @@ func (sp *shimPrivate) destroy() {
const (
// shimPipeWireTimeout is the duration pipewire-pulse is allowed to run
// before its socket becomes available.
- shimPipeWireTimeout = 5 * time.Second
+ shimPipeWireTimeout = 15 * time.Second
)
func shimEntrypoint(k syscallDispatcher) {
diff --git a/internal/pipewire/core.go b/internal/pipewire/core.go
index 2161acf7..026f75bb 100644
--- a/internal/pipewire/core.go
+++ b/internal/pipewire/core.go
@@ -514,7 +514,7 @@ var ErrNotDone = errors.New("did not receive a Core::Done event targeting previo
const (
// syncTimeout is the maximum duration [Core.Sync] is allowed to take before
// receiving [CoreDone] or failing.
- syncTimeout = 10 * time.Second
+ syncTimeout = RoundtripTimeout + 15*time.Second
)
// Sync queues a [CoreSync] message for the PipeWire server and initiates a Roundtrip.
diff --git a/internal/pipewire/pipewire.go b/internal/pipewire/pipewire.go
index bd1d4e8e..0538863a 100644
--- a/internal/pipewire/pipewire.go
+++ b/internal/pipewire/pipewire.go
@@ -701,14 +701,14 @@ func (ctx *Context) Roundtrip() (err error) {
}
const (
- // roundtripTimeout is the maximum duration socket operations during
+ // RoundtripTimeout is the maximum duration socket operations during
// Context.roundtrip is allowed to block for.
- roundtripTimeout = 5 * time.Second
+ RoundtripTimeout = 30 * time.Second
)
// roundtrip implements the Roundtrip method without checking proxyErrors.
func (ctx *Context) roundtrip() (err error) {
- ctx.conn.MightBlock(roundtripTimeout)
+ ctx.conn.MightBlock(RoundtripTimeout)
if err = ctx.sendmsg(ctx.buf, ctx.pendingFiles...); err != nil {
return
}
@@ -742,7 +742,7 @@ func (ctx *Context) roundtrip() (err error) {
}()
var remaining []byte
- ctx.conn.MightBlock(roundtripTimeout)
+ ctx.conn.MightBlock(RoundtripTimeout)
for {
remaining, err = ctx.consume(remaining)
if err == nil {
diff --git a/internal/pipewire/pipewire_test.go b/internal/pipewire/pipewire_test.go
index 0187391c..1671601c 100644
--- a/internal/pipewire/pipewire_test.go
+++ b/internal/pipewire/pipewire_test.go
@@ -717,7 +717,7 @@ type stubUnixConn struct {
}
func (conn *stubUnixConn) MightBlock(timeout time.Duration) {
- if timeout != 5*time.Second {
+ if timeout != pipewire.RoundtripTimeout {
panic("unexpected timeout " + timeout.String())
}
if conn.current == 0 ||
diff --git a/internal/system/pipewire_test.go b/internal/system/pipewire_test.go
index 052495cc..d1bf5781 100644
--- a/internal/system/pipewire_test.go
+++ b/internal/system/pipewire_test.go
@@ -499,7 +499,7 @@ type stubPipeWireConn struct {
}
func (conn *stubPipeWireConn) MightBlock(timeout time.Duration) {
- if timeout != 5*time.Second {
+ if timeout != pipewire.RoundtripTimeout {
panic("unexpected timeout " + timeout.String())
}
}
diff --git a/ldd/exec.go b/ldd/exec.go
index e59dfcaa..567f33ca 100644
--- a/ldd/exec.go
+++ b/ldd/exec.go
@@ -29,7 +29,7 @@ const (
lddName = "ldd"
// lddTimeout is the maximum duration ldd(1) is allowed to ran for before it
// is terminated.
- lddTimeout = 4 * time.Second
+ lddTimeout = 15 * time.Second
)
// Resolve runs ldd(1) in a strict sandbox and connects its stdout to a [Decoder].
@@ -96,7 +96,8 @@ func Resolve(
if err := z.Wait(); err != nil {
m := stderr.Bytes()
- if bytes.Contains(m, []byte(msgStaticSuffix)) || bytes.Contains(m, []byte(msgStaticGlibc)) {
+ if bytes.Contains(m, []byte(msgStaticSuffix)) ||
+ bytes.Contains(m, []byte(msgStaticGlibc)) {
return nil, nil
}