From 2c816b5d636b8f7decd234582470a3d4c6b4a93a Mon Sep 17 00:00:00 2001 From: Mission Liao Date: Tue, 21 Aug 2018 16:43:37 +0800 Subject: 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. --- core/test/scheduler_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/test/scheduler_test.go') 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 } } -- cgit v1.2.3