mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-20 21:33:19 -06:00
Update tests
This commit is contained in:
parent
c859164597
commit
82974a38e0
|
|
@ -160,18 +160,6 @@ func TestCorrectStreamWakeup(t *testing.T) {
|
||||||
streamone := lockedFetchUserStream(n, alice, "one")
|
streamone := lockedFetchUserStream(n, alice, "one")
|
||||||
streamtwo := lockedFetchUserStream(n, alice, "two")
|
streamtwo := lockedFetchUserStream(n, alice, "two")
|
||||||
|
|
||||||
wait := func(stream *UserDeviceStream) {
|
|
||||||
select {
|
|
||||||
case <-time.After(time.Second * 10):
|
|
||||||
return
|
|
||||||
default:
|
|
||||||
waitForBlocking(stream, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
go wait(streamone)
|
|
||||||
go wait(streamtwo)
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
select {
|
select {
|
||||||
case <-streamone.signalChannel:
|
case <-streamone.signalChannel:
|
||||||
|
|
@ -181,7 +169,7 @@ func TestCorrectStreamWakeup(t *testing.T) {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
time.Sleep(1 * time.Microsecond)
|
time.Sleep(1 * time.Second)
|
||||||
|
|
||||||
wake := "two"
|
wake := "two"
|
||||||
n.wakeupUserDevice(map[string]string{alice: wake}, syncPositionAfter)
|
n.wakeupUserDevice(map[string]string{alice: wake}, syncPositionAfter)
|
||||||
|
|
@ -354,7 +342,7 @@ func waitForEvents(n *Notifier, req syncRequest) (types.StreamingToken, error) {
|
||||||
func waitForBlocking(s *UserDeviceStream, numBlocking uint) {
|
func waitForBlocking(s *UserDeviceStream, numBlocking uint) {
|
||||||
for numBlocking != s.NumWaiting() {
|
for numBlocking != s.NumWaiting() {
|
||||||
// This is horrible but I don't want to add a signalling mechanism JUST for testing.
|
// This is horrible but I don't want to add a signalling mechanism JUST for testing.
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(1 * time.Microsecond)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue