diff --git a/pkg/expect/expect.go b/pkg/expect/expect.go index d5a25274101..48fcbf3163d 100644 --- a/pkg/expect/expect.go +++ b/pkg/expect/expect.go @@ -193,7 +193,7 @@ func (ep *ExpectProcess) ExpectFunc(ctx context.Context, f func(string) bool) (s select { case <-ctx.Done(): - return "", fmt.Errorf("failed to find match string: %w", ctx.Err()) + return "", fmt.Errorf("context done before matching log found") case <-time.After(time.Millisecond * 10): // continue loop } @@ -203,7 +203,7 @@ func (ep *ExpectProcess) ExpectFunc(ctx context.Context, f func(string) bool) (s // NOTE: we wait readCloseCh for ep.read() to complete draining the log before acquring the lock. case <-ep.readCloseCh: case <-ctx.Done(): - return "", fmt.Errorf("failed to find match string: %w", ctx.Err()) + return "", fmt.Errorf("context done before to found matching log") } ep.mu.Lock() diff --git a/tests/framework/e2e/etcd_process.go b/tests/framework/e2e/etcd_process.go index fe2a1765e02..93f01647fc5 100644 --- a/tests/framework/e2e/etcd_process.go +++ b/tests/framework/e2e/etcd_process.go @@ -255,7 +255,11 @@ func (ep *EtcdServerProcess) Close() error { func (ep *EtcdServerProcess) waitReady(ctx context.Context) error { defer close(ep.donec) - return WaitReadyExpectProc(ctx, ep.proc, EtcdServerReadyLines) + err := WaitReadyExpectProc(ctx, ep.proc, EtcdServerReadyLines) + if err != nil { + return fmt.Errorf("failed to find etcd ready lines %q, err: %w", EtcdServerReadyLines, err) + } + return nil } func (ep *EtcdServerProcess) Config() *EtcdServerProcessConfig { return ep.cfg } diff --git a/tests/robustness/failpoint/trigger.go b/tests/robustness/failpoint/trigger.go index 3f8e2990a2b..801c7484232 100644 --- a/tests/robustness/failpoint/trigger.go +++ b/tests/robustness/failpoint/trigger.go @@ -68,7 +68,7 @@ func (t triggerCompact) Trigger(ctx context.Context, _ *testing.T, member e2e.Et for { _, rev, err = cc.Get(ctx, "/", 0) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to get revision: %w", err) } if !t.multiBatchCompaction || rev > int64(clus.Cfg.ServerConfig.ExperimentalCompactionBatchLimit) {