Documentation
¶
Overview ¶
Package quicfault provides a deterministic, connection-aware HTTP/3 origin for transport recovery tests. It is deliberately test-oriented: callers can reject one request stream, hold an older-generation request until a newer connection is usable, and inspect which server-side QUIC connections remain alive after client drain.
Index ¶
- Constants
- type Origin
- func (o *Origin) ClientTLSConfig() *tls.Config
- func (o *Origin) Close(ctx context.Context) error
- func (o *Origin) CloseConnection(id uint64, code quic.ApplicationErrorCode) error
- func (o *Origin) ConnectionAlive(id uint64) bool
- func (o *Origin) ConnectionCount() uint64
- func (o *Origin) ReleaseHeld()
- func (o *Origin) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (o *Origin) URL(path string) string
- func (o *Origin) WaitBlocked(ctx context.Context) (uint64, error)
- func (o *Origin) WaitHeld(ctx context.Context) (uint64, error)
Constants ¶
const ( ConnectionHeader = "X-H3fuzz-Fault-Connection" PathOK = "/ok" PathRejectOnce = "/reject-once" PathRejectTwice = "/reject-twice" PathHoldReject = "/hold-reject" PathStreamReset = "/stream-reset" PathWait = "/wait" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Origin ¶
type Origin struct {
// contains filtered or unexported fields
}
Origin owns a real UDP listener and HTTP/3 server. Its controls are safe for concurrent use and intentionally expose only deterministic fault operations.
func (*Origin) ClientTLSConfig ¶
ClientTLSConfig returns a test-only client configuration for the generated certificate.
func (*Origin) Close ¶
Close stops accepting and closes every server-side connection. It is safe to call repeatedly.
func (*Origin) CloseConnection ¶
func (o *Origin) CloseConnection(id uint64, code quic.ApplicationErrorCode) error
CloseConnection terminates one named server-side connection.
func (*Origin) ConnectionAlive ¶
ConnectionAlive reports whether the named server-side QUIC connection is still open.
func (*Origin) ConnectionCount ¶
ConnectionCount returns how many QUIC connections reached ConnContext.
func (*Origin) ReleaseHeld ¶
func (o *Origin) ReleaseHeld()
ReleaseHeld makes the blocked old-generation request fail with H3_REQUEST_REJECTED. Its transparent retry will succeed on a newer connection.
func (*Origin) WaitBlocked ¶
WaitBlocked waits until a PathWait handler is waiting for caller cancellation or deadline expiry.