test: cover user-mode apply atomicity and non-blocking KILL
Some checks failed
check / check (push) Failing after 16s
Some checks failed
check / check (push) Failing after 16s
db: TestSetSessionUserModesIsAtomic installs a trigger that rejects the is_oper UPDATE after the is_wallops UPDATE has run, proving the '+w-o' partial-failure the old independent-UPDATE loop exhibited is gone. ircserver: TestDisconnectDoesNotBlockOnUnresponsiveVictim drives Disconnect against a net.Pipe victim that never reads and requires the call to return promptly; verified to fail against the synchronous implementation. Its counterpart asserts the notification is still delivered and the socket still closed.
This commit is contained in:
@@ -55,3 +55,21 @@ func (s *Server) Stop() {
|
||||
func (s *Server) Listener() net.Listener {
|
||||
return s.listener
|
||||
}
|
||||
|
||||
// NewTestConn wraps an already-established net.Conn in a
|
||||
// Conn so tests can drive connection-level behaviour such
|
||||
// as Disconnect without standing up a whole server.
|
||||
func NewTestConn(
|
||||
log *slog.Logger,
|
||||
cfg *config.Config,
|
||||
tcpConn net.Conn,
|
||||
nick string,
|
||||
) *Conn {
|
||||
conn := newConn(
|
||||
context.Background(), tcpConn, log,
|
||||
nil, nil, cfg, nil,
|
||||
)
|
||||
conn.nick = nick
|
||||
|
||||
return conn
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user