Let ircserver and db tests pass under heavy host load (closes #265)
check / check (push) Failing after 3s
check / check (push) Failing after 3s
testTimeout, the limit on every read and wait in the ircserver tests, goes from 5 to 30 seconds. A passing test never reaches it. TestQuietClientNotAnsweringPingIsClosed uses a 4 second ping interval, and measures its upper bound from the end of registration. The bound leaves 2.7 seconds for scheduling delay, and is a second before the close a two-interval read deadline would make. The lower bound, from the client's last line, is unchanged. The cancelled-query tests in internal/db run the endless query for 2 seconds instead of 100 ms. A context that ends before the statement starts interrupts nothing, so the pool kept its connection. Model: opus-5-5
This commit is contained in:
1 parent
72d8f2c12b
commit
dd4a3d85f4
2 files changed
+40
-11
No files matched your search
@@ -26,7 +26,11 @@ const (
|
||||
(SELECT 1 UNION ALL SELECT x + 1 FROM n)
|
||||
SELECT COUNT(*) FROM n`
|
||||
|
||||
endlessQueryTimeout = 100 * time.Millisecond
|
||||
// endlessQueryTimeout is how long the endless query runs
|
||||
// before its context ends. A query whose context ends before
|
||||
// it starts is never run, and the pool keeps its connection,
|
||||
// so the timeout leaves a loaded host time to start it.
|
||||
endlessQueryTimeout = 2 * time.Second
|
||||
)
|
||||
|
||||
// TestDefaultDBURLSetsWALAndBusyTimeout opens a file database
|
||||
|
||||
Reference in new issue
Block a user