Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed May 7, 2020
1 parent 21146a4 commit 61eccb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions server/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ func (c *TRPCClient) Send(msg *msgjson.Message) error {
c.sends = append(c.sends, msg)
return c.sendErr
}
func (c *TRPCClient) SendError(id uint64, msg *msgjson.Error) {
}
func (c *TRPCClient) Request(msg *msgjson.Message, f func(comms.Link, *msgjson.Message), _ time.Duration, _ func()) error {
c.reqs = append(c.reqs, &tReq{
msg: msg,
Expand Down
7 changes: 4 additions & 3 deletions server/market/epump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ func TestMarket_epochPumpHalt(t *testing.T) {

cancel() // testing len(ep.q) != 0 (stop after it drains the queue).
runtime.Gosched() // let Run start shutting things down
time.Sleep(100 * time.Millisecond)
time.Sleep(50 * time.Millisecond)

// Make sure epochs come out in order.
close(rq0.ready)
rq0Out = <-ePump.ready
if rq0Out.EpochQueue.Epoch != eq0.Epoch {
Expand All @@ -101,8 +102,8 @@ func TestMarket_epochPumpHalt(t *testing.T) {
if ok {
t.Errorf("ready channel should be closed now (Run returned), but something came through")
}
default:
t.Errorf("ready channel should be closed now (Run returned)")
case <-time.After(time.Second):
t.Errorf("ready channel should be closed by now (Run returned)")
}

rqX := ePump.Insert(eq2)
Expand Down

0 comments on commit 61eccb7

Please sign in to comment.