Skip to content

Commit

Permalink
assert progress during long test
Browse files Browse the repository at this point in the history
  • Loading branch information
stackdump committed May 21, 2019
1 parent 72b6939 commit d5b36f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions longTest/LoadWith1pctDrop_test.go
@@ -1,6 +1,7 @@
package longtest

import (
"github.com/stretchr/testify/assert"
"testing"
"time"

Expand Down Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion test.sh
Expand Up @@ -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; \
})
Expand Down

0 comments on commit d5b36f4

Please sign in to comment.