Wait for relay accounting after packet delivery
1 file changed,
+5
−0
internal/relay/server_test.go+5 −0
CI passed — run details
diff --git a/internal/relay/server_test.go b/internal/relay/server_test.go| index 3ba4b66f6..043d53bee 100644 |
| --- a/internal/relay/server_test.go |
| +++ b/internal/relay/server_test.go |
| @@ -218,6 +218,11 @@ func TestServerRelaysBothLegs(t *testing.T) { |
| } |
| id := Identity{"abc", "meet"} |
| + // Socket delivery can finish before the forwarding goroutine records bytes. |
| + waitFor(t, func() bool { |
| + in, out, _ := meter.totals(id) |
| + return in >= 4 && out >= 4 |
| + }) |
| in, out, _ := meter.totals(id) |
| if in < 4 { |
| t.Fatalf("in = %d, want at least the 4 bytes forwarded to the peer", in) |