2019-01-24 20:15:10 +00:00
|
|
|
// Copyright (C) 2019 Storj Labs, Inc.
|
2018-07-19 20:41:29 +01:00
|
|
|
// See LICENSE for copying information.
|
|
|
|
|
|
|
|
package telemetry
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestJitter_NegativeDuration(t *testing.T) {
|
|
|
|
duration := time.Duration(-1)
|
|
|
|
expected := time.Duration(1)
|
|
|
|
|
|
|
|
actual := jitter(duration)
|
|
|
|
|
|
|
|
assert.Equal(t, expected, actual)
|
|
|
|
}
|