Skip to content

Commit

Permalink
Merge pull request onflow#5953 from AndriiDiachuk/access-cohort3-inte…
Browse files Browse the repository at this point in the history
…gration-tests-fix

[Access] Access-Cohort3 integration tests are flaky
  • Loading branch information
Guitarheroua authored May 28, 2024
2 parents 778a287 + 8a03502 commit 1ac121d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions integration/tests/access/cohort3/grpc_state_stream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ func (s *GrpcStateStreamSuite) TestHappyPath() {

targetEvent := flow.EventType("flow.AccountCreated")

foundANTxCount := 0
foundANTxTestCount := 0
foundANTxControlCount := 0
foundONTxCount := 0

messageIndex := counters.NewMonotonousCounter(0)

r := NewResponseTracker(compareEventsResponse, 3)
Expand All @@ -252,16 +254,16 @@ func (s *GrpcStateStreamSuite) TestHappyPath() {
if has(event.Events, targetEvent) {
s.T().Logf("adding access test events: %d %d %v", event.Height, len(event.Events), event.Events)
r.Add(s.T(), event.Height, "access_test", event)
foundANTxCount++
foundANTxTestCount++
}
case event := <-controlANEvents:
if has(event.Events, targetEvent) {
if ok := messageIndex.Set(event.MessageIndex); !ok {
s.Require().NoErrorf(err, "messageIndex isn`t sequential")
}

s.T().Logf("adding control events: %d %d %v", event.Height, len(event.Events), event.Events)
r.Add(s.T(), event.Height, "access_control", event)
foundANTxControlCount++
}
case event := <-testONEvents:
if has(event.Events, targetEvent) {
Expand All @@ -271,7 +273,9 @@ func (s *GrpcStateStreamSuite) TestHappyPath() {
}
}

if foundANTxCount >= txCount && foundONTxCount >= txCount {
if foundANTxTestCount >= txCount &&
foundONTxCount >= txCount &&
foundANTxControlCount >= txCount {
break
}
}
Expand Down

0 comments on commit 1ac121d

Please sign in to comment.