diff --git a/internal/dbus/dbus_test.go b/internal/dbus/dbus_test.go index 5d6e4c4..f617556 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 378d947..c16ff36 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 dae098b..a44d5ed 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 0612718..10a3c0c 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 8e722f7..5e3e6aa 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 6f509e1..d2706c8 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 2161acf..026f75b 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 bd1d4e8..0538863 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 0187391..1671601 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 052495c..d1bf578 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 e59dfca..567f33c 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 }