MCPcopy Create free account
hub / github.com/erpc/erpc / TestTryFastFailOpen_RespectsFailOpenConfig

Function TestTryFastFailOpen_RespectsFailOpenConfig

auth/strategy_database_test.go:287–294  ·  view source on GitHub ↗

TestTryFastFailOpen_RespectsFailOpenConfig verifies that when fail-open is not configured, we never fast-path — strict-auth semantics are preserved even if connectorDown is flipped by an earlier failure.

(t *testing.T)

Source from the content-addressed store, hash-verified

285// is not configured, we never fast-path — strict-auth semantics are
286// preserved even if connectorDown is flipped by an earlier failure.
287func TestTryFastFailOpen_RespectsFailOpenConfig(t *testing.T) {
288 t.Parallel()
289 fc := &fakeConnector{id: "test"}
290 s := newTestStrategyWith(t, fc, false /* failOpenEnabled */)
291 s.markConnectorDown()
292 assert.Nil(t, s.tryFastFailOpen(),
293 "must not fast-path when fail-open is disabled — caller must still run real DB path")
294}
295
296// TestTryFastFailOpen_HealthyConnector verifies that with fail-open enabled
297// but connector healthy, we return nil (normal DB path).

Callers

nothing calls this directly

Calls 3

newTestStrategyWithFunction · 0.85
markConnectorDownMethod · 0.80
tryFastFailOpenMethod · 0.80

Tested by

no test coverage detected