mirror of
https://github.com/strukturag/nextcloud-spreed-signaling.git
synced 2025-04-17 16:52:32 +00:00
Don't redefine built-in id "max".
This commit is contained in:
parent
119b1ff39d
commit
c642319514
1 changed files with 4 additions and 4 deletions
|
@ -64,7 +64,7 @@ func testNatsClient_Subscribe(t *testing.T, client NatsClient) {
|
||||||
ch := make(chan struct{})
|
ch := make(chan struct{})
|
||||||
|
|
||||||
var received atomic.Int32
|
var received atomic.Int32
|
||||||
max := int32(20)
|
maxPublish := int32(20)
|
||||||
ready := make(chan struct{})
|
ready := make(chan struct{})
|
||||||
quit := make(chan struct{})
|
quit := make(chan struct{})
|
||||||
defer close(quit)
|
defer close(quit)
|
||||||
|
@ -74,7 +74,7 @@ func testNatsClient_Subscribe(t *testing.T, client NatsClient) {
|
||||||
select {
|
select {
|
||||||
case <-dest:
|
case <-dest:
|
||||||
total := received.Add(1)
|
total := received.Add(1)
|
||||||
if total == max {
|
if total == maxPublish {
|
||||||
if err := sub.Unsubscribe(); !assert.NoError(err) {
|
if err := sub.Unsubscribe(); !assert.NoError(err) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ func testNatsClient_Subscribe(t *testing.T, client NatsClient) {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
<-ready
|
<-ready
|
||||||
for i := int32(0); i < max; i++ {
|
for i := int32(0); i < maxPublish; i++ {
|
||||||
assert.NoError(client.Publish("foo", []byte("hello")))
|
assert.NoError(client.Publish("foo", []byte("hello")))
|
||||||
|
|
||||||
// Allow NATS goroutines to process messages.
|
// Allow NATS goroutines to process messages.
|
||||||
|
@ -94,7 +94,7 @@ func testNatsClient_Subscribe(t *testing.T, client NatsClient) {
|
||||||
}
|
}
|
||||||
<-ch
|
<-ch
|
||||||
|
|
||||||
require.EqualValues(max, received.Load(), "Received wrong # of messages")
|
require.EqualValues(maxPublish, received.Load(), "Received wrong # of messages")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestNatsClient_Subscribe(t *testing.T) {
|
func TestNatsClient_Subscribe(t *testing.T) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue