From d5c4d31d0d1d6799cd4db0a067cc9024567420e3 Mon Sep 17 00:00:00 2001 From: olegshmuelov <45327364+olegshmuelov@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:04:00 +0200 Subject: [PATCH] fail on unexpected err --- ekm/signer_key_manager_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ekm/signer_key_manager_test.go b/ekm/signer_key_manager_test.go index df65412157..fb3a384c99 100644 --- a/ekm/signer_key_manager_test.go +++ b/ekm/signer_key_manager_test.go @@ -849,9 +849,12 @@ func TestConcurrentSlashingProtectionAttData(t *testing.T) { // Count errors and successes. var slashableErrors, successCount int for err := range errChan { - if err != nil && err.Error() == "slashable attestation (HighestAttestationVote), not signing" { + if err != nil { + if err.Error() != "slashable attestation (HighestAttestationVote), not signing" { + require.Fail(t, "unexpected error: %v", err) + } slashableErrors++ - } else if err == nil { + } else { successCount++ } } @@ -904,9 +907,12 @@ func TestConcurrentSlashingProtectionBeaconBlock(t *testing.T) { // Count errors and successes. var slashableErrors, successCount int for err := range errChan { - if err != nil && err.Error() == "slashable proposal (HighestProposalVote), not signing" { + if err != nil { + if err.Error() != "slashable proposal (HighestProposalVote), not signing" { + require.Fail(t, "unexpected error: %v", err) + } slashableErrors++ - } else if err == nil { + } else { successCount++ } }