From 30f4edf48daa48ac567747dbec14540997e23be8 Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Mon, 19 Feb 2024 19:15:52 +0100 Subject: [PATCH] fix: keep flaky tests compilable and easy to find --- protocol/communities_messenger_test.go | 2 + ...nities_messenger_token_permissions_test.go | 20 ++++++++++ .../messenger_communities_sharding_test.go | 2 + protocol/messenger_contact_requests_test.go | 40 +++++++++++++++++++ protocol/messenger_offline_test.go | 2 + protocol/messenger_profile_showcase_test.go | 2 + server/pairing/sync_device_test.go | 2 + 7 files changed, 70 insertions(+) diff --git a/protocol/communities_messenger_test.go b/protocol/communities_messenger_test.go index 8e4222a60..1eb9df481 100644 --- a/protocol/communities_messenger_test.go +++ b/protocol/communities_messenger_test.go @@ -3454,6 +3454,8 @@ func (s *MessengerCommunitiesSuite) TestStartCommunityRekeyLoop() { } func (s *MessengerCommunitiesSuite) TestCommunityRekeyAfterBan() { + s.T().Skip("flaky test") + s.owner.communitiesManager.RekeyInterval = 500 * time.Minute _, err := s.owner.Start() diff --git a/protocol/communities_messenger_token_permissions_test.go b/protocol/communities_messenger_token_permissions_test.go index ca29e8545..96ff7ea47 100644 --- a/protocol/communities_messenger_token_permissions_test.go +++ b/protocol/communities_messenger_token_permissions_test.go @@ -240,6 +240,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) waitOnKeyDistribution(condit } func (s *MessengerCommunitiesTokenPermissionsSuite) TestCreateTokenPermission() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() createTokenPermission := &requests.CreateCommunityTokenPermission{ @@ -273,6 +275,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestCreateTokenPermission() } func (s *MessengerCommunitiesTokenPermissionsSuite) TestEditTokenPermission() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() tokenPermission := &requests.CreateCommunityTokenPermission{ @@ -329,6 +333,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestEditTokenPermission() { } func (s *MessengerCommunitiesTokenPermissionsSuite) TestCommunityTokensMetadata() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() tokensMetadata := community.CommunityTokensMetadata() @@ -421,6 +427,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestRequestAccessWithENSToke } func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinedCommunityMembersSharedAddress() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() s.advertiseCommunityTo(community, s.alice) s.advertiseCommunityTo(community, s.bob) @@ -471,6 +479,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinedCommunityMembersSh } func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinedCommunityMembersSelectedSharedAddress() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() s.advertiseCommunityTo(community, s.alice) @@ -499,6 +509,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinedCommunityMembersSe } func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinedCommunityMembersMultipleSelectedSharedAddresses() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() s.advertiseCommunityTo(community, s.alice) @@ -529,6 +541,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinedCommunityMembersMu } func (s *MessengerCommunitiesTokenPermissionsSuite) TestEditSharedAddresses() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() s.advertiseCommunityTo(community, s.alice) @@ -820,6 +834,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestBecomeMemberPermissions( }*/ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinCommunityWithAdminPermission() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() // setup become admin permission @@ -854,6 +870,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinCommunityWithAdminPe } func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinCommunityAsMemberWithMemberAndAdminPermission() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() waitOnCommunityPermissionCreated := waitOnCommunitiesEvent(s.owner, func(sub *communities.Subscription) bool { @@ -923,6 +941,8 @@ func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinCommunityAsMemberWit } func (s *MessengerCommunitiesTokenPermissionsSuite) TestJoinCommunityAsAdminWithMemberAndAdminPermission() { + s.T().Skip("flaky test") + community, _ := s.createCommunity() // setup become member permission diff --git a/protocol/messenger_communities_sharding_test.go b/protocol/messenger_communities_sharding_test.go index 3e43c532b..6b6d57a3e 100644 --- a/protocol/messenger_communities_sharding_test.go +++ b/protocol/messenger_communities_sharding_test.go @@ -147,6 +147,8 @@ func (s *MessengerCommunitiesShardingSuite) TestPostToCommunityChat() { } func (s *MessengerCommunitiesShardingSuite) TestIgnoreOutdatedShardKey() { + s.T().Skip("flaky test") + community, _ := createCommunity(&s.Suite, s.owner) advertiseCommunityToUserOldWay(&s.Suite, community, s.owner, s.alice) diff --git a/protocol/messenger_contact_requests_test.go b/protocol/messenger_contact_requests_test.go index 804ec5b04..c43ad9959 100644 --- a/protocol/messenger_contact_requests_test.go +++ b/protocol/messenger_contact_requests_test.go @@ -432,6 +432,8 @@ func (s *MessengerContactRequestSuite) syncInstallationContactV2FromContact(cont } func (s *MessengerContactRequestSuite) TestReceiveAndAcceptContactRequest() { //nolint: unused + s.T().Skip("flaky test") + messageText := "hello!" theirMessenger := s.newMessenger() @@ -450,6 +452,8 @@ func (s *MessengerContactRequestSuite) TestReceiveAndAcceptContactRequest() { // } func (s *MessengerContactRequestSuite) TestReceiveAndDismissContactRequest() { + s.T().Skip("flaky test") + messageText := "hello!" theirMessenger := s.newMessenger() @@ -468,6 +472,8 @@ func (s *MessengerContactRequestSuite) TestReceiveAndDismissContactRequest() { } func (s *MessengerContactRequestSuite) TestReceiveAcceptAndRetractContactRequest() { //nolint: unused + s.T().Skip("flaky test") + messageText := "hello!" theirMessenger := s.newMessenger() @@ -494,6 +500,8 @@ func (s *MessengerContactRequestSuite) TestReceiveAcceptAndRetractContactRequest // 2.2) Bob accepts the contact request // 2.3) Alice removes bob from contacts func (s *MessengerContactRequestSuite) TestAcceptCRRemoveAndRepeat() { + s.T().Skip("flaky test") + theirMessenger := s.newMessenger() _, err := theirMessenger.Start() s.Require().NoError(err) @@ -519,6 +527,8 @@ func (s *MessengerContactRequestSuite) TestAcceptCRRemoveAndRepeat() { // 2) Bob declines the contact request // 3) Alice fails to send a new contact request to Bob func (s *MessengerContactRequestSuite) TestAliceTriesToSpamBobWithContactRequests() { + s.T().Skip("flaky test") + messageTextAlice := "You wanna play with fire, Bobby?!" alice := s.m @@ -575,6 +585,8 @@ func (s *MessengerContactRequestSuite) TestAliceTriesToSpamBobWithContactRequest // 3) Bob accepts the contact request (again!) // 4) No extra mesages on Alice's side func (s *MessengerContactRequestSuite) TestAliceSeesOnlyOneAcceptFromBob() { + s.T().Skip("flaky test") + messageTextAlice := "You wanna play with fire, Bobby?!" alice := s.m @@ -632,6 +644,8 @@ func (s *MessengerContactRequestSuite) TestAliceSeesOnlyOneAcceptFromBob() { } func (s *MessengerContactRequestSuite) TestReceiveAndAcceptContactRequestTwice() { //nolint: unused + s.T().Skip("flaky test") + messageText := "hello!" theirMessenger := s.newMessenger() @@ -676,6 +690,8 @@ func (s *MessengerContactRequestSuite) TestReceiveAndAcceptContactRequestTwice() } func (s *MessengerContactRequestSuite) TestAcceptLatestContactRequestForContact() { + s.T().Skip("flaky test") + messageText := "hello!" theirMessenger := s.newMessenger() @@ -771,6 +787,8 @@ func (s *MessengerContactRequestSuite) TestAcceptLatestContactRequestForContact( } func (s *MessengerContactRequestSuite) TestDismissLatestContactRequestForContact() { + s.T().Skip("flaky test") + messageText := "hello!" theirMessenger := s.newMessenger() @@ -804,6 +822,8 @@ func (s *MessengerContactRequestSuite) TestDismissLatestContactRequestForContact } func (s *MessengerContactRequestSuite) TestPairedDevicesRemoveContact() { + s.T().Skip("flaky test") + messageText := "hello!" alice1 := s.m @@ -879,6 +899,8 @@ func (s *MessengerContactRequestSuite) TestPairedDevicesRemoveContact() { // Bob will need to help Alice recover her state, since as far as he can see // that's an already accepted contact request func (s *MessengerContactRequestSuite) TestAliceRecoverStateSendContactRequest() { + s.T().Skip("flaky test") + messageText := "hello!" alice1 := s.m @@ -951,6 +973,8 @@ func (s *MessengerContactRequestSuite) TestAliceRecoverStateSendContactRequest() // 4) Bob sends a message to alice // Alice will show a contact request from bob func (s *MessengerContactRequestSuite) TestAliceRecoverStateReceiveContactRequest() { + s.T().Skip("flaky test") + messageText := "hello!" alice1 := s.m @@ -1032,6 +1056,8 @@ func (s *MessengerContactRequestSuite) TestAliceRecoverStateReceiveContactReques // 5) Alice adds bob back to her contacts // 6) Bob goes online, they receive 4 and 5 in the correct order func (s *MessengerContactRequestSuite) TestAliceOfflineRetractsAndAddsCorrectOrder() { + s.T().Skip("flaky test") + messageText := "hello!" alice1 := s.m @@ -1082,6 +1108,8 @@ func (s *MessengerContactRequestSuite) TestAliceOfflineRetractsAndAddsCorrectOrd // 5) Alice adds bob back to her contacts // 6) Bob goes online, they receive 4 and 5 in the wrong order func (s *MessengerContactRequestSuite) TestAliceOfflineRetractsAndAddsWrongOrder() { + s.T().Skip("flaky test") + messageText := "hello!" alice1 := s.m @@ -1136,6 +1164,8 @@ func (s *MessengerContactRequestSuite) TestAliceOfflineRetractsAndAddsWrongOrder // 5) Alice sends new contact request // 6) Bob accepts new contact request func (s *MessengerContactRequestSuite) TestAliceResendsContactRequestAfterRemovingBobFromContacts() { + s.T().Skip("flaky test") + messageTextFirst := "hello 1!" theirMessenger := s.newMessenger() @@ -1252,6 +1282,8 @@ func (s *MessengerContactRequestSuite) TestBobSendsContactRequestAfterDecliningO } func (s *MessengerContactRequestSuite) TestBuildContact() { + s.T().Skip("flaky test") + contactKey, err := crypto.GenerateKey() s.Require().NoError(err) contactID := types.EncodeHex(crypto.FromECDSAPub(&contactKey.PublicKey)) @@ -1270,6 +1302,8 @@ func (s *MessengerContactRequestSuite) TestBuildContact() { } func (s *MessengerContactRequestSuite) TestReceiveAcceptAndRetractContactRequestOutOfOrder() { + s.T().Skip("flaky test") + message := protobuf.ChatMessage{ Clock: 4, Timestamp: 1, @@ -1323,6 +1357,8 @@ func (s *MessengerContactRequestSuite) TestReceiveAcceptAndRetractContactRequest // 5) Bob succesefully accepts restored contact request // 6) Alice get notified properly func (s *MessengerContactRequestSuite) TestBobRestoresIncomingContactRequestFromSyncInstallationContactV2() { + s.T().Skip("flaky test") + messageText := "hello, Bobby!" alice := s.m @@ -1403,6 +1439,8 @@ func (s *MessengerContactRequestSuite) TestBobRestoresIncomingContactRequestFrom // 5) Bob accepts contact request // 6) Alice get notified properly func (s *MessengerContactRequestSuite) TestAliceRestoresOutgoingContactRequestFromSyncInstallationContactV2() { + s.T().Skip("flaky test") + messageText := "hello, Bobby!" alice1 := s.m @@ -1597,6 +1635,8 @@ func (s *MessengerContactRequestSuite) unblockContactAndSync(alice1 *Messenger, } func (s *MessengerContactRequestSuite) TestBlockedContactSyncing() { + s.T().Skip("flaky test") + // Setup Bob bob := s.newMessenger() _, err := bob.Start() diff --git a/protocol/messenger_offline_test.go b/protocol/messenger_offline_test.go index d2e4fd74e..3c36102ff 100644 --- a/protocol/messenger_offline_test.go +++ b/protocol/messenger_offline_test.go @@ -107,6 +107,8 @@ func (s *MessengerOfflineSuite) joinCommunity(community *communities.Community, } func (s *MessengerOfflineSuite) TestCommunityOfflineEdit() { + s.T().Skip("flaky test") + community, chat := createCommunity(&s.Suite, s.owner) chatID := chat.ID diff --git a/protocol/messenger_profile_showcase_test.go b/protocol/messenger_profile_showcase_test.go index ff1b59ee0..cb94428d3 100644 --- a/protocol/messenger_profile_showcase_test.go +++ b/protocol/messenger_profile_showcase_test.go @@ -288,6 +288,8 @@ func (s *TestMessengerProfileShowcase) TestEncryptAndDecryptProfileShowcaseEntri } func (s *TestMessengerProfileShowcase) TestShareShowcasePreferences() { + s.T().Skip("flaky test") + // Set Display name to pass shouldPublishChatIdentity check profileKp := accounts.GetProfileKeypairForTest(true, false, false) profileKp.KeyUID = s.m.account.KeyUID diff --git a/server/pairing/sync_device_test.go b/server/pairing/sync_device_test.go index d734d7da0..f23bb2885 100644 --- a/server/pairing/sync_device_test.go +++ b/server/pairing/sync_device_test.go @@ -880,6 +880,8 @@ func (s *SyncDeviceSuite) TestTransferringKeystoreFiles() { } func (s *SyncDeviceSuite) TestTransferringKeystoreFilesAfterStopUisngKeycard() { + s.T().Skip("flaky test") + ctx := context.TODO() // Prepare server