diff --git a/test/loadtime/payload/payload_test.go b/test/loadtime/payload/payload_test.go index aceb47717..9b3f5fdea 100644 --- a/test/loadtime/payload/payload_test.go +++ b/test/loadtime/payload/payload_test.go @@ -9,7 +9,10 @@ import ( const payloadSizeTarget = 1024 // 1kb func TestSize(t *testing.T) { - s := payload.UnpaddedSizeBytes() + s, err := payload.MaxUnpaddedSize() + if err != nil { + t.Fatalf("calculating max unpadded size %s", err) + } if s > payloadSizeTarget { t.Fatalf("unpadded payload size %d exceeds target %d", s, payloadSizeTarget) } @@ -20,10 +23,10 @@ func TestRoundTrip(t *testing.T) { testConns = 512 testRate = 4 ) - b, err := payload.NewBytes(payload.Options{ - Size: payloadSizeTarget, - Conns: testConns, - Rate: testRate, + b, err := payload.NewBytes(&payload.Payload{ + Size: payloadSizeTarget, + Connections: testConns, + Rate: testRate, }) if err != nil { t.Fatalf("generating payload %s", err) diff --git a/test/loadtime/report/report.go b/test/loadtime/report/report.go index 59467f14d..41e4a93aa 100644 --- a/test/loadtime/report/report.go +++ b/test/loadtime/report/report.go @@ -94,7 +94,8 @@ func GenerateFromBlockStore(s BlockStore) (Report, error) { r.All = append(r.All, pd.l) if pd.l > r.Max { r.Max = pd.l - } else if pd.l < r.Min { + } + if pd.l < r.Min { r.Min = pd.l } // Using an int64 here makes an assumption about the scale and quantity of the data we are processing. diff --git a/test/loadtime/report/report_test.go b/test/loadtime/report/report_test.go index 8af9b0b34..00a169229 100644 --- a/test/loadtime/report/report_test.go +++ b/test/loadtime/report/report_test.go @@ -74,14 +74,15 @@ func TestGenerateReport(t *testing.T) { t.Fatalf("Avg did not match expected. Expected %s but contained %s", 5*time.Second, r.Avg) } if r.Min != 4*time.Second { - t.Fatalf("Avg did not match expected. Expected %s but contained %s", 4*time.Second, r.Min) + t.Fatalf("Min did not match expected. Expected %s but contained %s", 4*time.Second, r.Min) } if r.Max != 6*time.Second { - t.Fatalf("Avg did not match expected. Expected %s but contained %s", 6*time.Second, r.Max) + t.Fatalf("Max did not match expected. Expected %s but contained %s", 6*time.Second, r.Max) } // Verified using online standard deviation calculator: // https://www.calculator.net/standard-deviation-calculator.html?numberinputs=6%2C+4&ctype=p&x=84&y=27 - if r.StdDev != time.Second { - t.Fatalf("StdDev did not match expected. Expected %s but contained %s", time.Second, r.StdDev) + expectedStdDev := 1414213562 * time.Nanosecond + if r.StdDev != expectedStdDev { + t.Fatalf("StdDev did not match expected. Expected %s but contained %s", expectedStdDev, r.StdDev) } }