Skip to content

Commit

Permalink
tests/ordering: removed dead code and fixed QF
Browse files Browse the repository at this point in the history
Since we're now using maps in QF, we can no longer simply return index 0
  • Loading branch information
johningve committed Jul 8, 2020
1 parent cf73db2 commit 14288a9
Showing 1 changed file with 5 additions and 22 deletions.
27 changes: 5 additions & 22 deletions tests/ordering/order_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package ordering

import (
"context"
"fmt"
"net"
"sync"
"testing"
"time"
Expand All @@ -13,25 +11,6 @@ import (
"google.golang.org/grpc"
)

type portSupplier struct {
p int
sync.Mutex
}

func (p *portSupplier) get() int {
p.Lock()
newPort := p.p
p.p++
p.Unlock()
return newPort
}

var supplier = portSupplier{p: 22332}

func getListener() (net.Listener, error) {
return net.Listen("tcp", fmt.Sprintf(":%d", supplier.get()))
}

type testSrv struct {
sync.Mutex
lastNum uint64
Expand Down Expand Up @@ -78,7 +57,11 @@ func (q testQSpec) qf(replies map[uint32]*Response) (*Response, bool) {
return reply, true
}
}
return replies[0], true
var reply *Response
for _, r := range replies {
reply = r
}
return reply, true
}

func (q testQSpec) QCQF(_ *Request, replies map[uint32]*Response) (*Response, bool) {
Expand Down

0 comments on commit 14288a9

Please sign in to comment.