Skip to content

Commit

Permalink
Return errFake in mockClient used for tests
Browse files Browse the repository at this point in the history
If the test runs long enough then the RTX timer will send a Transaction
and return a empty TransactionResult + nil err resulted in a crash
  • Loading branch information
Sean-Der committed Apr 4, 2024
1 parent 40c468b commit 3a965fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (c *mockClient) PerformTransaction(msg *stun.Message, to net.Addr, dontWait
if c.performTransaction != nil {
return c.performTransaction(msg, to, dontWait)
}
return TransactionResult{}, nil
return TransactionResult{}, errFake
}

func (c *mockClient) OnDeallocated(relayedAddr net.Addr) {
Expand Down

0 comments on commit 3a965fe

Please sign in to comment.