mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
Move nonblocking AddSnowflake out of goroutine in sqs test
This fixes a race condition in tests where sometimes snowflake matching happens before enough snowflakes get added to the heap.
This commit is contained in:
parent
50bed1e67a
commit
80374c6d93
1 changed files with 1 additions and 1 deletions
|
@ -140,8 +140,8 @@ func TestSQS(t *testing.T) {
|
|||
mockSQSClient.EXPECT().ReceiveMessage(sqsHandlerContext, &sqsReceiveMessageInput).AnyTimes().DoAndReturn(
|
||||
func(ctx context.Context, input *sqs.ReceiveMessageInput, optFns ...func(*sqs.Options)) (*sqs.ReceiveMessageOutput, error) {
|
||||
|
||||
snowflake := ipcCtx.AddSnowflake("fake", "", NATUnrestricted, 0)
|
||||
go func(c C) {
|
||||
snowflake := ipcCtx.AddSnowflake("fake", "", NATUnrestricted, 0)
|
||||
<-snowflake.offerChannel
|
||||
snowflake.answerChannel <- "fake answer"
|
||||
}(c)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue