From d5b36f44db70a018856ad2dedaf4ec67c5643e56 Mon Sep 17 00:00:00 2001 From: stackdump Date: Tue, 21 May 2019 17:17:45 -0500 Subject: [PATCH] assert progress during long test --- longTest/LoadWith1pctDrop_test.go | 20 +++++++++++++------- test.sh | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/longTest/LoadWith1pctDrop_test.go b/longTest/LoadWith1pctDrop_test.go index b314a22d8e..b104a781e6 100644 --- a/longTest/LoadWith1pctDrop_test.go +++ b/longTest/LoadWith1pctDrop_test.go @@ -1,6 +1,7 @@ package longtest import ( + "github.com/stretchr/testify/assert" "testing" "time" @@ -47,13 +48,18 @@ func TestLoadWith1pctDrop(t *testing.T) { state0 := StartSim(nodesLoadWith1pctDrop, params) // adjust simulation parameters - RunCmd("s") - RunCmd("Re") - RunCmd("r") - RunCmd("S10") - RunCmd("F500") - RunCmd("R5") + RunCmd("s") // show node state summary + RunCmd("Re") // keep reloading EC wallet on 'tight' schedule (only small amounts) + RunCmd("r") // reset all nodes in the simulation (maybe not needed) + RunCmd("S10") // message drop rate 1% + RunCmd("F500") // add 500 ms delay to all messages + RunCmd("R5") // Load 5 msgs/sec time.Sleep(time.Second * 300) // wait 5 min - t.Logf("LLHT: %v<=>%v", state0.GetDBHeightAtBoot(), state0.GetDBHeightComplete()) + startHt := state0.GetDBHeightAtBoot() + endHt := state0.GetDBHeightComplete() + t.Logf("LLHT: %v<=>%v", startHt, endHt) + + // normally without load we expect to create 10 blocks over the span of 5 min + assert.True(t, endHt - startHt >= 5) // check that we created at least 1 block per min } diff --git a/test.sh b/test.sh index a3aff194bd..907ad7b87c 100755 --- a/test.sh +++ b/test.sh @@ -15,7 +15,7 @@ function runTests() { # 4. all sets of A/B tests in peerTest package TESTS=$({ \ glide nv | grep -v Utilities | grep -v longTest | grep -v peerTest | grep -v simTest | grep -v elections | grep -v activations | grep -v netTest | grep "..." ; \ - cat engine/ci_whitelist.txt; \ + cat engine/ci_whitelist; \ ls simTest/*_test.go; \ ls peerTest/*A_test.go; \ })