diff --git a/tests/framework/e2e/etcd_process.go b/tests/framework/e2e/etcd_process.go index af5c437c7c75..12511f2b8d4e 100644 --- a/tests/framework/e2e/etcd_process.go +++ b/tests/framework/e2e/etcd_process.go @@ -375,7 +375,11 @@ func (f *BinaryFailpoints) SetupHTTP(ctx context.Context, failpoint, payload str } defer resp.Body.Close() if resp.StatusCode != http.StatusNoContent { - return fmt.Errorf("bad status code: %d", resp.StatusCode) + errMsg, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + return fmt.Errorf("bad status code: %d (%v)", resp.StatusCode, errMsg) } return nil } @@ -404,17 +408,18 @@ func (f *BinaryFailpoints) DeactivateHTTP(ctx context.Context, failpoint string) } defer resp.Body.Close() if resp.StatusCode != http.StatusNoContent { - return fmt.Errorf("bad status code: %d", resp.StatusCode) + errMsg, err := io.ReadAll(resp.Body) + if err != nil { + return err + } + return fmt.Errorf("bad status code: %d (%v)", resp.StatusCode, errMsg) } return nil } func (f *BinaryFailpoints) Enabled() bool { _, err := failpoints(f.member) - if err != nil { - return false - } - return true + return err == nil } func (f *BinaryFailpoints) Available(failpoint string) bool {