Skip to content

Commit

Permalink
Added test for QueueSetting's Validate method
Browse files Browse the repository at this point in the history
  • Loading branch information
FreakyNobleGas committed Feb 3, 2022
1 parent 64c6f9e commit d92357e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions exporter/exporterhelper/queued_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,17 @@ func TestNoCancellationContext(t *testing.T) {
assert.True(t, d.IsZero())
}

func TestQueueSettings_Validate(t *testing.T) {
qCfg := DefaultQueueSettings()
assert.NoError(t, qCfg.Validate())

qCfg.QueueSize = -1
assert.EqualError(t, qCfg.Validate(), "queue size can't be negative")

qCfg.QueueSize = 0
assert.EqualError(t, qCfg.Validate(), "a 0 size queue will drop all the data")
}

type mockErrorRequest struct {
baseRequest
}
Expand Down

0 comments on commit d92357e

Please sign in to comment.