Skip to content

Commit cbba328

Browse files
committed
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"
1 parent 1b6a6cc commit cbba328

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/integration/framework/etcd.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ func RunCustomEtcd(logger klog.Logger, dataDir string, customFlags []string) (ur
151151
go func() {
152152
defer wg.Done()
153153
buffer := make([]byte, 100*1024)
154+
reading:
154155
for {
155156
n, err := reader.Read(buffer)
156157
// 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
177178
if err != nil {
178179
offset := int(dec.InputOffset())
179180
if offset < n {
180-
logger.Info("etcd output", "msg", string(buffer[0:n]))
181+
logger.Info("etcd output", "msg", string(buffer[offset:n]))
181182
}
182-
continue
183+
continue reading
183184
}
184185

185186
// Skip harmless messages.

0 commit comments

Comments
 (0)