From e76d93d34001dd2373d4d3b3d76e4a813dd82fb4 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Sat, 27 Jul 2024 10:27:26 +0100 Subject: [PATCH] chore: skip flaky tests (#5606) * chore_: skip TestPeerCount * chore_: skip flaky wallet tests * chore_: skip flaky TestMemberReceivesPendingRequestToJoinAfterAfterGettingTokenMasterRole --- ...es_messenger_shared_member_address_test.go | 3 ++ services/wallet/router/router_v2_test.go | 35 ++++++++++++------- services/wallet/router/router_v2_test_data.go | 3 ++ telemetry/client_test.go | 2 ++ 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/protocol/communities_messenger_shared_member_address_test.go b/protocol/communities_messenger_shared_member_address_test.go index b3a250422..08f5844b6 100644 --- a/protocol/communities_messenger_shared_member_address_test.go +++ b/protocol/communities_messenger_shared_member_address_test.go @@ -10,6 +10,7 @@ import ( gethcommon "github.com/ethereum/go-ethereum/common" hexutil "github.com/ethereum/go-ethereum/common/hexutil" + gethbridge "github.com/status-im/status-go/eth-node/bridge/geth" "github.com/status-im/status-go/eth-node/crypto" "github.com/status-im/status-go/eth-node/types" @@ -819,6 +820,8 @@ func (s *MessengerCommunitiesSharedMemberAddressSuite) TestTokenMasterReceivesAc } func (s *MessengerCommunitiesSharedMemberAddressSuite) TestMemberReceivesPendingRequestToJoinAfterAfterGettingTokenMasterRole() { + s.T().Skip("flaky test") + community, _ := createOnRequestCommunity(&s.Suite, s.owner) advertiseCommunityTo(&s.Suite, community, s.owner, s.alice) diff --git a/services/wallet/router/router_v2_test.go b/services/wallet/router/router_v2_test.go index 76fda581b..a16e5c8cb 100644 --- a/services/wallet/router/router_v2_test.go +++ b/services/wallet/router/router_v2_test.go @@ -210,6 +210,9 @@ func TestNoBalanceForTheBestRouteRouterV2(t *testing.T) { // Test blocking endpoints for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + if tt.flaky { + t.Skip("Flaky test") + } routes, err := router.SuggestedRoutesV2(context.Background(), tt.input) @@ -230,20 +233,26 @@ func TestNoBalanceForTheBestRouteRouterV2(t *testing.T) { // Test async endpoints for _, tt := range tests { - router.SuggestedRoutesV2Async(tt.input) - - select { - case asyncRoutes := <-suggestedRoutesCh: - assert.Equal(t, tt.input.Uuid, asyncRoutes.Uuid) - assert.Equal(t, tt.expectedError, asyncRoutes.ErrorResponse) - assertPathsEqual(t, tt.expectedCandidates, asyncRoutes.Candidates) - if tt.expectedError == nil { - assertPathsEqual(t, tt.expectedBest, asyncRoutes.Best) + t.Run(tt.name, func(t *testing.T) { + if tt.flaky { + t.Skip("Flaky test") } - break - case <-time.After(10 * time.Second): - t.FailNow() - } + + router.SuggestedRoutesV2Async(tt.input) + + select { + case asyncRoutes := <-suggestedRoutesCh: + assert.Equal(t, tt.input.Uuid, asyncRoutes.Uuid) + assert.Equal(t, tt.expectedError, asyncRoutes.ErrorResponse) + assertPathsEqual(t, tt.expectedCandidates, asyncRoutes.Candidates) + if tt.expectedError == nil { + assertPathsEqual(t, tt.expectedBest, asyncRoutes.Best) + } + break + case <-time.After(10 * time.Second): + t.FailNow() + } + }) } } diff --git a/services/wallet/router/router_v2_test_data.go b/services/wallet/router/router_v2_test_data.go index 985cd4e8b..8eaf1cde5 100644 --- a/services/wallet/router/router_v2_test_data.go +++ b/services/wallet/router/router_v2_test_data.go @@ -2594,6 +2594,7 @@ type noBalanceTestParams struct { expectedCandidates []*PathV2 expectedBest []*PathV2 expectedError *errors.ErrorResponse + flaky bool } func getNoBalanceTestParamsList() []noBalanceTestParams { @@ -2726,6 +2727,7 @@ func getNoBalanceTestParamsList() []noBalanceTestParams { approvalL1Fee: testApprovalL1Fee, }, }, + flaky: true, expectedError: &errors.ErrorResponse{ Code: ErrNotEnoughTokenBalance.Code, Details: fmt.Sprintf(ErrNotEnoughTokenBalance.Details, pathprocessor.UsdcSymbol, walletCommon.EthereumMainnet), @@ -2786,6 +2788,7 @@ func getNoBalanceTestParamsList() []noBalanceTestParams { approvalL1Fee: testApprovalL1Fee, }, }, + flaky: true, expectedError: &errors.ErrorResponse{ Code: ErrNotEnoughNativeBalance.Code, Details: fmt.Sprintf(ErrNotEnoughNativeBalance.Details, pathprocessor.EthSymbol, walletCommon.EthereumMainnet), diff --git a/telemetry/client_test.go b/telemetry/client_test.go index 566829315..8eb121c13 100644 --- a/telemetry/client_test.go +++ b/telemetry/client_test.go @@ -352,6 +352,8 @@ func setDefaultConfig(config *wakuv2.Config, lightMode bool) { var testStoreENRBootstrap = "enrtree://AI4W5N5IFEUIHF5LESUAOSMV6TKWF2MB6GU2YK7PU4TYUGUNOCEPW@store.staging.shards.nodes.status.im" func TestPeerCount(t *testing.T) { + t.Skip("flaky test") + expectedCondition := func(received []TelemetryRequest) (shouldSucceed bool, shouldFail bool) { found := slices.ContainsFunc(received, func(req TelemetryRequest) bool { t.Log(req)