From 2fe91af63f15e77458800b8f19a344ded10ed289 Mon Sep 17 00:00:00 2001 From: Kaloyan Tanev <24719519+KaloyanTanev@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:25:05 +0200 Subject: [PATCH] *: fix flaky testpeers test (#3267) - fix test peers on timeout, sometimes it went in the case where the current context is done, but the result of the currently running test wasn't sent to the channel - fix wrongly named variables category: test ticket: none --- cmd/testbeacon.go | 4 ++-- cmd/testmev.go | 4 ++-- cmd/testpeers.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/testbeacon.go b/cmd/testbeacon.go index 6a137f4c2..78a14adb4 100644 --- a/cmd/testbeacon.go +++ b/cmd/testbeacon.go @@ -156,8 +156,8 @@ func testAllBeacons(ctx context.Context, queuedTestCases []testCaseName, allTest doneReading := make(chan bool) go func() { - for singlePeerRes := range singleBeaconResCh { - maps.Copy(allBeaconsRes, singlePeerRes) + for singleBeaconRes := range singleBeaconResCh { + maps.Copy(allBeaconsRes, singleBeaconRes) } doneReading <- true }() diff --git a/cmd/testmev.go b/cmd/testmev.go index 31ea63a9b..cb1ffd4ff 100644 --- a/cmd/testmev.go +++ b/cmd/testmev.go @@ -137,8 +137,8 @@ func testAllMEVs(ctx context.Context, queuedTestCases []testCaseName, allTestCas doneReading := make(chan bool) go func() { - for singlePeerRes := range singleMEVResCh { - maps.Copy(allMEVsRes, singlePeerRes) + for singleMEVRes := range singleMEVResCh { + maps.Copy(allMEVsRes, singleMEVRes) } doneReading <- true }() diff --git a/cmd/testpeers.go b/cmd/testpeers.go index c4fb6b939..b9c729997 100644 --- a/cmd/testpeers.go +++ b/cmd/testpeers.go @@ -499,6 +499,7 @@ func runPeerTest(ctx context.Context, queuedTestCases []testCaseName, allTestCas for _, t := range queuedTestCases { select { case <-ctx.Done(): + testResCh <- failedTestResult(testResult{Name: t.name}, errTimeoutInterrupted) return default: testResCh <- allTestCases[t](ctx, &conf, tcpNode, target)