Skip to content

Commit

Permalink
non-blocking send
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryFissionGames committed Jul 1, 2024
1 parent 0d0b5e3 commit 578e3ec
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions opamp/observiq/measurements_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ func TestMeasurementsSender(t *testing.T) {
client := mocks.NewMockOpAMPClient(t)
client.On("SendCustomMessage", mock.Anything).Run(func(args mock.Arguments) {
cm := args.Get(0).(*protobufs.CustomMessage)
dataChan <- cm.Data
select {
case dataChan <- cm.Data:
default:
}

}).Return(make(chan struct{}), nil)

mp := metric.NewMeterProvider()
Expand Down Expand Up @@ -88,7 +92,10 @@ func TestMeasurementsSender(t *testing.T) {
client := mocks.NewMockOpAMPClient(t)
client.On("SendCustomMessage", mock.Anything).Run(func(args mock.Arguments) {
cm := args.Get(0).(*protobufs.CustomMessage)
dataChan <- cm.Data
select {
case dataChan <- cm.Data:
default:
}
}).Return(make(chan struct{}), nil)

mp := metric.NewMeterProvider()
Expand Down

0 comments on commit 578e3ec

Please sign in to comment.