Skip to content

Commit

Permalink
Merge pull request lightningnetwork#7894 from yyforyongyu/fix-lnwire-…
Browse files Browse the repository at this point in the history
…test-flake

trivial: fix unit test flake for `Ping` message
  • Loading branch information
guggero authored Aug 18, 2023
2 parents 4f9c099 + 70bd6d1 commit 4a03074
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lnwire/lnwire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,9 @@ func TestLightningWireProtocol(t *testing.T) {
//
// We'll allow the test to generate padding bytes up to
// the max message limit, factoring in the 2 bytes for
// the num pong bytes.
paddingBytes := make([]byte, r.Intn(MaxMsgBody-1))
// the num pong bytes and 2 bytes for encoding the
// length of the padding bytes.
paddingBytes := make([]byte, rand.Intn(MaxMsgBody-3))
req := Ping{
NumPongBytes: uint16(r.Intn(MaxPongBytes + 1)),
PaddingBytes: paddingBytes,
Expand Down

0 comments on commit 4a03074

Please sign in to comment.