Skip to content
Snippets Groups Projects
Commit da59983e authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

changed the source of RNG for mutate timestamp test to see if it fixes the test

parent 3ba34b5d
No related branches found
No related tags found
5 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!371[Channel RSAtoPrivate] Implement Reverse Asymmetric in Client/Broadcast,!354Channels impl,!340Project/channels
package channels package channels
import ( import (
"crypto/rand" "math/rand"
"testing" "testing"
"time" "time"
...@@ -29,9 +29,11 @@ func TestMutateTimestampDeltaAverage(t *testing.T) { ...@@ -29,9 +29,11 @@ func TestMutateTimestampDeltaAverage(t *testing.T) {
t1 := time.Now() t1 := time.Now()
sum := int64(0) sum := int64(0)
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
for i := 0; i < samples; i++ { for i := 0; i < samples; i++ {
var msgID channel.MessageID var msgID channel.MessageID
rand.Read(msgID[:]) rng.Read(msgID[:])
t2 := mutateTimestamp(t1, msgID) t2 := mutateTimestamp(t1, msgID)
delta := t2.Sub(t1) delta := t2.Sub(t1)
sum += abs(int64(delta)) sum += abs(int64(delta))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment