Skip to content

Commit

Permalink
Fix flaky test TestUploadIntentsInBatches (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBollag authored Oct 2, 2023
1 parent dfdd4ff commit d5d5108
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/mapper/pkg/clouduploader/cloud_uploader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,11 @@ func (s *CloudUploaderTestSuite) TestUploadIntentsInBatches() {
intentInput("client1", s.testNamespace, "server2", "external-namespace"),
}

firstReport := s.clientMock.EXPECT().ReportDiscoveredIntents(gomock.Any(), GetMatcher([]cloudclient.IntentInput{intents1[0]})).Return(nil).Times(1)
secondReport := s.clientMock.EXPECT().ReportDiscoveredIntents(gomock.Any(), GetMatcher([]cloudclient.IntentInput{intents1[1]})).Return(nil).Times(1)
gomock.InOrder(
firstReport,
secondReport,
)
// This can happen in any order, but either way only one intent should be uploaded at a batch
s.clientMock.EXPECT().ReportDiscoveredIntents(gomock.Any(), GetMatcher([]cloudclient.IntentInput{intents1[0]})).Return(nil).Times(1)
s.clientMock.EXPECT().ReportDiscoveredIntents(gomock.Any(), GetMatcher([]cloudclient.IntentInput{intents1[1]})).Return(nil).Times(1)

s.cloudUploader.uploadDiscoveredIntents(context.Background())

}

func (s *CloudUploaderTestSuite) TestDontUploadWithoutIntents() {
Expand Down

0 comments on commit d5d5108

Please sign in to comment.