Skip to content

[Failing test] Networking IPerf2 started failing with the new agnhost image #132166

Open
@aojea

Description

@aojea

The test parses the iperf2 output to obtain the metrics and assert of them, however, the output is not standard and may break between iperf2 versions , see 853b24b per example

Tested started to fail after the bump of agnhost in #132117

https://testgrid.k8s.io/sig-network-kind#sig-network-kind,%20detect-local-node-cidr

{ failed [FAILED] unable to parse iperf2 output from client pod iperf2-clients-5fl95 (node kind-worker): incorrect fields in the output: [time srcaddress srcport dstaddr dstport transferid istart iend bytes speed writecnt writeerr tcpretry tcpcwnd tcppcwnd tcprtt tcprttvar] (17 out of 15)

I0605 19:10:41.969293 75351 networking_perf.go:253] output from exec on client pod iperf2-clients-5fl95 (node kind-worker):
time,srcaddress,srcport,dstaddr,dstport,transferid,istart,iend,bytes,speed,writecnt,writeerr,tcpretry,tcpcwnd,tcppcwnd,tcprtt,tcprttvar
+0000:20250605191028.955,10.244.2.64,43380,10.96.223.154,6789,1,0.0,1.0,7817396288,62539170304,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191029.955,10.244.2.64,43380,10.96.223.154,6789,1,1.0,2.0,7550795776,60406366208,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191030.955,10.244.2.64,43380,10.96.223.154,6789,1,2.0,3.0,8703574016,69628592128,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191031.955,10.244.2.64,43380,10.96.223.154,6789,1,3.0,4.0,6392119296,51136954368,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191032.955,10.244.2.64,43380,10.96.223.154,6789,1,4.0,5.0,7658536960,61268295680,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191033.955,10.244.2.64,43380,10.96.223.154,6789,1,5.0,6.0,9065463808,72523710464,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191034.955,10.244.2.64,43380,10.96.223.154,6789,1,6.0,7.0,9136766976,73094135808,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191035.955,10.244.2.64,43380,10.96.223.154,6789,1,7.0,8.0,8786018304,70288146432,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191036.955,10.244.2.64,43380,10.96.223.154,6789,1,8.0,9.0,8709341184,69674729472,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191037.955,10.244.2.64,43380,10.96.223.154,6789,1,9.0,10.0,8794144768,70353158144,-1,-1,4294967295,-1,4294967295,0,0
+0000:20250605191036.957,10.244.2.64,43380,10.96.223.154,6789,1,0.0,10.0,82614419520,66081649801,-1,-1,4294967295,-1,4294967295,0,0

I0605 19:10:41.969312 75351 networking_perf.go:262] Retrying: IPerf run failed: incorrect fields in the output: [time srcaddress srcport dstaddr dstport transferid istart iend bytes speed writecnt writeerr tcpretry tcpcwnd tcppcwnd tcprtt tcprttvar] (17 out of 15)
I0605 19:10:41.969319 75351 networking_perf.go:251] attempting to run command 'iperf -e -p 6789 --reportstyle C -i 1 -c iperf2-server && sleep 5' in client pod iperf2-clients-5fl95 (node kind-worker)

We should adapt the code to the changes on the new iperf2 version

// ParseIPerf2EnhancedResultsFromCSV parses results from iperf2 when given the -e (--enhancedreports)
// and `--reportstyle C` options.
// Example output for version < 2.19 (agnhost < 2.53):
// 20201210141800.884,10.244.2.24,47880,10.96.114.79,6789,3,0.0-1.0,1677852672,13422821376
// 20201210141801.881,10.244.2.24,47880,10.96.114.79,6789,3,1.0-2.0,1980760064,15846080512
// 20201210141802.883,10.244.2.24,47880,10.96.114.79,6789,3,2.0-3.0,1886650368,15093202944
// Example output with version >= 2.19 (agnhost >= 2.53)
// +0000:20240908113035.128,192.168.9.3,58256,192.168.9.4,5001,1,0.0-1.0,5220466748,41763733984,-1,-1,-1,-1,0,0
// +0000:20240908113036.128,192.168.9.3,58256,192.168.9.4,5001,1,1.0-2.0,5127667712,41021341696,-1,-1,-1,-1,0,0
// +0000:20240908113037.128,192.168.9.3,58256,192.168.9.4,5001,1,2.0-3.0,5127405568,41019244544,-1,-1,-1,-1,0,0
// +0000:20240908113038.128,192.168.9.3,58256,192.168.9.4,5001,1,3.0-4.0,5173018624,41384148992,-1,-1,-1,-1,0,0
// +0000:20240908113039.128,192.168.9.3,58256,192.168.9.4,5001,1,4.0-5.0,5245894656,41967157248,-1,-1,-1,-1,0,0
// +0000:20240908113040.128,192.168.9.3,58256,192.168.9.4,5001,1,5.0-6.0,5213257728,41706061824,-1,-1,-1,-1,0,0
// +0000:20240908113041.128,192.168.9.3,58256,192.168.9.4,5001,1,6.0-7.0,5113118720,40904949760,-1,-1,-1,-1,0,0
// +0000:20240908113042.128,192.168.9.3,58256,192.168.9.4,5001,1,7.0-8.0,5242748928,41941991424,-1,-1,-1,-1,0,0
func ParseIPerf2EnhancedResultsFromCSV(output string) (*IPerf2EnhancedCSVResults, error) {
var parsedResults []*IPerfCSVResult
for _, line := range strings.Split(output, "\n") {
parsed, err := NewIPerf(line)
if err != nil {
return nil, err
}
parsedResults = append(parsedResults, parsed)
}
if len(parsedResults) == 0 {
return nil, fmt.Errorf("no results parsed from iperf2 output")
}
// format:
// all but last lines are intervals
intervals := parsedResults[:len(parsedResults)-1]
// last line is an aggregation
total := parsedResults[len(parsedResults)-1]
return &IPerf2EnhancedCSVResults{
Intervals: intervals,
Total: total,
}, nil
}

/sig network
/kind failing-test

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/failing-testCategorizes issue or PR as related to a consistently or frequently failing test.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.sig/networkCategorizes an issue or PR as relevant to SIG Network.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions