MCPcopy
hub / github.com/etcd-io/etcd / TestLogObserver_Timeout

Function TestLogObserver_Timeout

tests/framework/testutils/log_observer_test.go:29–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestLogObserver_Timeout(t *testing.T) {
30 logCore, logOb := NewLogObserver(zap.InfoLevel)
31
32 logger := zap.New(logCore)
33 logger.Info(t.Name())
34
35 ctx, cancel := context.WithTimeout(context.TODO(), 100*time.Millisecond)
36 _, err := logOb.Expect(ctx, "unknown", 1)
37 cancel()
38 require.ErrorIs(t, err, context.DeadlineExceeded)
39
40 assert.Len(t, logOb.entries, 1)
41}
42
43func TestLogObserver_Expect(t *testing.T) {
44 logCore, logOb := NewLogObserver(zap.InfoLevel)

Callers

nothing calls this directly

Calls 5

NewLogObserverFunction · 0.85
InfoMethod · 0.80
NameMethod · 0.65
LenMethod · 0.65
ExpectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…