Improve e2e error reporting

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
Co-authored-by: James Blair <mail@jamesblair.net>
Co-authored-by: chao <chaochn@amazon.com>
This commit is contained in:
Marek Siarkowicz 2024-06-01 10:42:23 +02:00
parent 2f216dcc94
commit 3c5684967f
3 changed files with 8 additions and 4 deletions

View File

@ -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()

View File

@ -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 }

View File

@ -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) {