Skip to content

Commit

Permalink
set verbosity conditined on verbose tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Feb 7, 2024
1 parent d70fac8 commit 55492eb
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
8 changes: 6 additions & 2 deletions internal/reliabletransport/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ func Test_newReliableReceiver(t *testing.T) {
}

func Test_reliableQueue_MaybeInsertIncoming(t *testing.T) {
log.SetLevel(log.DebugLevel)
if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}

type fields struct {
incomingPackets incomingSequence
Expand Down Expand Up @@ -91,7 +93,9 @@ func Test_reliableQueue_MaybeInsertIncoming(t *testing.T) {
}

func Test_reliableQueue_NextIncomingSequence(t *testing.T) {
log.SetLevel(log.DebugLevel)
if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}

type fields struct {
lastConsumed model.PacketID
Expand Down
5 changes: 3 additions & 2 deletions internal/reliabletransport/reliable_ack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import (
ack
*/
func TestReliable_ACK(t *testing.T) {

log.SetLevel(log.DebugLevel)
if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}

type args struct {
inputSequence []string
Expand Down
1 change: 0 additions & 1 deletion internal/reliabletransport/reliable_loss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ drop◄─┤ │
▼relay (ack)
*/
func TestReliable_WithLoss(t *testing.T) {

if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}
Expand Down
21 changes: 11 additions & 10 deletions internal/reliabletransport/reliable_reorder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@ import (

// test that we're able to reorder (towards TLS) whatever is received (from the muxer).
//
// dataOut
// dataOut
// ▲
// │
// ┌────┐ ┌──┴─┐
// │sndr│ │rcvr│
// └────┘ └────┘
// ▲
// │
// ┌────┐ ┌──┴─┐
// │sndr│ │rcvr│
// └────┘ └────┘
// ▲
// |
// dataIn
// |
// dataIn
func TestReliable_Reordering_UP(t *testing.T) {

log.SetLevel(log.DebugLevel)
if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}

type args struct {
inputSequence []string
Expand Down
8 changes: 6 additions & 2 deletions internal/reliabletransport/sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ func Test_newReliableSender(t *testing.T) {
}

func Test_reliableSender_TryInsertOutgoingPacket(t *testing.T) {
log.SetLevel(log.DebugLevel)
if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}

type fields struct {
inFlight inflightSequence
Expand Down Expand Up @@ -106,7 +108,9 @@ func Test_reliableSender_TryInsertOutgoingPacket(t *testing.T) {
}

func Test_reliableSender_NextPacketIDsToACK(t *testing.T) {
log.SetLevel(log.DebugLevel)
if testing.Verbose() {
log.SetLevel(log.DebugLevel)
}

type fields struct {
pendingACKsToSend []model.PacketID
Expand Down

0 comments on commit 55492eb

Please sign in to comment.