Skip to content

Commit

Permalink
Timing issue with unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulSnow committed Apr 28, 2017
1 parent fceea26 commit bd174fc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions engine/MsgLogging_test.go
Expand Up @@ -7,6 +7,8 @@ import (
"github.com/FactomProject/factomd/state"
"github.com/FactomProject/factomd/common/messages"
"github.com/FactomProject/factomd/common/primitives"

"time"
)


Expand Down Expand Up @@ -38,12 +40,12 @@ func TestMessageLoging(t *testing.T) {
}
msgLog.PrtMsgs(s)

msgLog.Last = primitives.NewTimestampFromMilliseconds(0)
msgLog.Last.SetTimeSeconds(msgLog.Last.GetTimeSeconds()-6)
time.Sleep(10*time.Millisecond)
msgLog.Add2(fnode, false, "peer","where",true,msg)


if len(msgLog.MsgList) != 1 {
t.Error("Should have one message")
if len(msgLog.MsgList) != 0 {
t.Error("Should have zero messages")
}
msgLog.PrtMsgs(s)
}

0 comments on commit bd174fc

Please sign in to comment.