mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-24 22:32:15 +00:00
feedback tweaks
This commit is contained in:
parent
5474528db1
commit
c62b7fbd7e
@ -23,12 +23,12 @@ type handleFunc = func(event Event) (Event, error)
|
||||
// sent events and produce `last()` event representing the terminal state.
|
||||
type Routine struct {
|
||||
name string
|
||||
handle handleFunc
|
||||
queue *queue.PriorityQueue
|
||||
out chan Event // XXX: actually item
|
||||
out chan Event
|
||||
fin chan error
|
||||
rdy chan struct{}
|
||||
running *uint32
|
||||
handle handleFunc
|
||||
logger log.Logger
|
||||
metrics *Metrics
|
||||
}
|
||||
@ -38,8 +38,8 @@ var queueSize int = 10
|
||||
func newRoutine(name string, handleFunc handleFunc) *Routine {
|
||||
return &Routine{
|
||||
name: name,
|
||||
queue: queue.NewPriorityQueue(queueSize, true),
|
||||
handle: handleFunc,
|
||||
queue: queue.NewPriorityQueue(queueSize, true),
|
||||
out: make(chan Event, queueSize),
|
||||
rdy: make(chan struct{}, 1),
|
||||
fin: make(chan error, 1),
|
||||
|
@ -143,8 +143,12 @@ func TestPriority(t *testing.T) {
|
||||
}()
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
|
||||
assert.True(t, routine.isRunning(),
|
||||
"expected an started routine")
|
||||
assert.True(t, routine.trySend(highPriorityEvent{}),
|
||||
"expected send to succeed even when saturated")
|
||||
|
||||
assert.Equal(t, done, <-routine.final())
|
||||
assert.False(t, routine.isRunning(),
|
||||
"expected an started routine")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user