D2c: PassingCause knows git's could-not-resolve-host and a client's timeout (ADR 0664 §1, issue 1748)
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
+14
-12
@@ -317,18 +317,20 @@ func TestPauseCapacityAndComposerKey(t *testing.T) {
|
||||
// Issue 1748 (ADR 0664): a transport fault is told from a wrong source by its words; a step given again is no end; the
|
||||
// bus waits 1 minute after the first run and 4 after the second.
|
||||
for words, want := range map[string]bool{
|
||||
`Get "https://proxy": dial tcp: lookup proxy.golang.org: i/o timeout`: true,
|
||||
`Head http://store.internal:5100/v2/x: dial tcp 10.10.0.1:5100: i/o timeout`: true,
|
||||
"kex_exchange_identification: read: Connection reset by peer": true,
|
||||
"Connection closed by 10.10.0.1 port 222": true,
|
||||
"npm error code EAI_AGAIN": true,
|
||||
"npm error code ETIMEDOUT": true,
|
||||
"npm error code ECONNRESET": true,
|
||||
(&HolderSilent{Seat: "go-package-registry", Holder: "gopkgs", Node: "ace"}).Error(): true,
|
||||
"nats: no responders available for request": false,
|
||||
"fatal: unknown revision or path not in the working tree": false,
|
||||
"verifying module: checksum mismatch": false,
|
||||
"./main.go:3:1: syntax error: unexpected }": false,
|
||||
`Get "https://proxy": dial tcp: lookup proxy.golang.org: i/o timeout`: true,
|
||||
`Head http://store.internal:5100/v2/x: dial tcp 10.10.0.1:5100: i/o timeout`: true,
|
||||
"kex_exchange_identification: read: Connection reset by peer": true,
|
||||
"Connection closed by 10.10.0.1 port 222": true,
|
||||
"npm error code EAI_AGAIN": true,
|
||||
"npm error code ETIMEDOUT": true,
|
||||
"npm error code ECONNRESET": true,
|
||||
"fatal: unable to access the forge: Could not resolve host: mesh-forge": true,
|
||||
"Get \"https://example.com/x.tar.gz\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)": true,
|
||||
(&HolderSilent{Seat: "go-package-registry", Holder: "gopkgs", Node: "ace"}).Error(): true,
|
||||
"nats: no responders available for request": false,
|
||||
"fatal: unknown revision or path not in the working tree": false,
|
||||
"verifying module: checksum mismatch": false,
|
||||
"./main.go:3:1: syntax error: unexpected }": false,
|
||||
} {
|
||||
if PassingCause(words) != want {
|
||||
t.Errorf("PassingCause(%q) = %v, want %v", words, !want, want)
|
||||
|
||||
@@ -41,7 +41,7 @@ func (h *HolderSilent) Unwrap() error { return &Passing{Err: errors.New(h.Error(
|
||||
// one: it is the same for a seat nothing holds (HolderSilent is the case a holder is named).
|
||||
var passingWords = []string{"i/o timeout", "no such host", "temporary failure in name resolution", "connection refused",
|
||||
"connection reset", "tls handshake timeout", "lookup ", "kex_exchange_identification", "connection closed by",
|
||||
"eai_again", "etimedout", "econnreset", "econnrefused", "enotfound", strings.ToLower(HolderSilentWords)}
|
||||
"could not resolve host", "client.timeout", "operation timed out", "connection timed out", "eai_again", "etimedout", "econnreset", "econnrefused", "enotfound", strings.ToLower(HolderSilentWords)}
|
||||
|
||||
// PassingCause says words (a tool's output or a step's reason) are those of a transport fault.
|
||||
func PassingCause(words string) bool {
|
||||
|
||||
Reference in New Issue
Block a user