From cbba3281a3aeed79daa4d6f8d0e6588c4dfea747 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 18 Jul 2025 18:46:25 +0200 Subject: [PATCH] integration: fix etcd output handling The code path for handling non-JSON output from etcd was broken: - It did not skip over already parsed JSON output. - It got stuck in the wrong for loop and repeatedly tried parsing the same non-JSON output. This prevented test shutdown. Not sure why yet, but in the branch with DRA v1 graduation the following error started to show up for the first time (?!): 2025/07/18 19:24:48 WARNING: [core] [Server #3]grpc: Server.processUnaryRPC failed to write status: connection error: desc = "transport is closing" --- test/integration/framework/etcd.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/framework/etcd.go b/test/integration/framework/etcd.go index f7261be3d21..1c0f6699433 100644 --- a/test/integration/framework/etcd.go +++ b/test/integration/framework/etcd.go @@ -151,6 +151,7 @@ func RunCustomEtcd(logger klog.Logger, dataDir string, customFlags []string) (ur go func() { defer wg.Done() buffer := make([]byte, 100*1024) + reading: for { n, err := reader.Read(buffer) // Unfortunately in practice we get an untyped errors.errorString wrapped in an os.Path error, @@ -177,9 +178,9 @@ func RunCustomEtcd(logger klog.Logger, dataDir string, customFlags []string) (ur if err != nil { offset := int(dec.InputOffset()) if offset < n { - logger.Info("etcd output", "msg", string(buffer[0:n])) + logger.Info("etcd output", "msg", string(buffer[offset:n])) } - continue + continue reading } // Skip harmless messages.