Skip to content

Commit

Permalink
fixed some err of integration test
Browse files Browse the repository at this point in the history
Signed-off-by: axfor <aixiaoxiang2009@hotmail.com>
  • Loading branch information
axfor committed Mar 18, 2023
1 parent 90ddffc commit 7294b58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/ingester/app/consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ func (c *Consumer) Start() {
ctx, cancel := context.WithCancel(context.Background())
c.cancel = cancel
c.doneWg.Add(1)

var firstStart sync.WaitGroup
firstStart.Add(1)
go func() {
firstStart.Done()
defer c.doneWg.Done()
for {
select {
Expand All @@ -92,6 +96,7 @@ func (c *Consumer) Start() {
}
}
}()
firstStart.Wait()
}

// Close closes the Consumer and underlying sarama consumer
Expand Down
3 changes: 3 additions & 0 deletions plugin/storage/integration/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func (s *KafkaIntegrationTestSuite) initialize() error {
}
spanConsumer.Start()

//wait consumer running
time.Sleep(time.Second * 5)

s.SpanWriter = spanWriter
s.SpanReader = &ingester{traceStore}
s.Refresh = func() error { return nil }
Expand Down

0 comments on commit 7294b58

Please sign in to comment.