aboutsummaryrefslogtreecommitdiffstats
path: root/core/test/scheduler_test.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-08-21 16:43:37 +0800
committerGitHub <noreply@github.com>2018-08-21 16:43:37 +0800
commit2c816b5d636b8f7decd234582470a3d4c6b4a93a (patch)
tree5eff9d5f035dda8e3b2632ecce41f3c192e90f21 /core/test/scheduler_test.go
parente8f99372159a89fb3128b870de1733a4777a5144 (diff)
downloadtangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.tar
tangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.tar.gz
tangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.tar.bz2
tangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.tar.lz
tangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.tar.xz
tangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.tar.zst
tangerine-consensus-2c816b5d636b8f7decd234582470a3d4c6b4a93a.zip
simulation: add simulation with scheduler (#71)
- Add new field in test.Event: HistoryIndex HistoryIndex allow us to access them by their position in event history. - Record local time in test.App when receiving events. - Add statisitics module for slices of test.Event. - add new command line utility *dexcon-simulation-with-scheduler to verify the execution time of core.Consensus.
Diffstat (limited to 'core/test/scheduler_test.go')
-rw-r--r--core/test/scheduler_test.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/test/scheduler_test.go b/core/test/scheduler_test.go
index c67240f..5aef36e 100644
--- a/core/test/scheduler_test.go
+++ b/core/test/scheduler_test.go
@@ -165,7 +165,8 @@ func (s *SchedulerTestSuite) TestChildEvent() {
req.True(e.Time.Sub(curEvent.Time) >= 1300*time.Millisecond)
// Make sure ParentTime field is set and is equal to parent event's
// time.
- req.Equal(e.ParentTime, curEvent.Time)
+ req.NotEqual(-1, e.ParentHistoryIndex)
+ req.Equal(e.ParentHistoryIndex, curEvent.HistoryIndex)
curEvent = e
}
}