forked from rosa/hakurei
all: raise timeout defaults
This avoids timing out on systems running very slowly. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var FulfillmentTimeout = 2 * time.Second
|
||||
var FulfillmentTimeout = 15 * time.Second
|
||||
|
||||
func init() {
|
||||
if testing.Testing() {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user