Skip to content

Commit

Permalink
Remove a test that no longer works
Browse files Browse the repository at this point in the history
This is related to #62 in which we removed the use of immediate ack (I)
bit. This test became unstable as we no longer use immediate ack.
Relates to pion/webrtc#1270
  • Loading branch information
enobufs committed Jul 13, 2020
1 parent 17f97e4 commit 9119023
Showing 1 changed file with 0 additions and 78 deletions.
78 changes: 0 additions & 78 deletions association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2022,84 +2022,6 @@ func TestAssocDelayedAck(t *testing.T) {

closeAssociationPair(br, a0, a1)
})

t.Run("Second DATA chunk to generate SACK immedidately", func(t *testing.T) {
lim := test.TimeOut(time.Second * 10)
defer lim.Stop()

const si uint16 = 6
var n int
var nPacketsReceived int
var ppi PayloadProtocolIdentifier
sbuf := make([]byte, 4000) // size should be less than initial cwnd (4380)
rbuf := make([]byte, 4000)

_, err := cryptoRand.Read(sbuf)
if !assert.Nil(t, err, "failed to create associations") {
return
}

br := test.NewBridge()

a0, a1, err := createNewAssociationPair(br, ackModeAlwaysDelay, 0)
if !assert.Nil(t, err, "failed to create associations") {
assert.FailNow(t, "failed due to earlier error")
}

s0, s1, err := establishSessionPair(br, a0, a1, si)
assert.Nil(t, err, "failed to establish session pair")

a0.stats.reset()
a1.stats.reset()

// Writes data (will fragmented)
n, err = s0.WriteSCTP(sbuf, PayloadTypeWebRTCBinary)
assert.Nil(t, err, "WriteSCTP failed")
assert.Equal(t, n, len(sbuf), "unexpected length of received data")

// Repeat calling br.Tick() until the buffered amount becomes 0
for s0.BufferedAmount() > 0 {
for {
n = br.Tick()
if n == 0 {
break
}
}

for {
s1.lock.RLock()
readable := s1.reassemblyQueue.isReadable()
s1.lock.RUnlock()
if !readable {
break
}
n, ppi, err = s1.ReadSCTP(rbuf)
if !assert.Nil(t, err, "ReadSCTP failed") {
return
}
assert.Equal(t, len(sbuf), n, "unexpected length of received data")
assert.Equal(t, ppi, PayloadTypeWebRTCBinary, "unexpected ppi")

nPacketsReceived++
}
}

br.Process()

assert.Equal(t, 1, nPacketsReceived, "should be one packet received")
assert.Equal(t, 0, s1.getNumBytesInReassemblyQueue(), "reassembly queue should be empty")

t.Logf("nDATAs : %d\n", a1.stats.getNumDATAs())
t.Logf("nSACKs : %d\n", a0.stats.getNumSACKs())
t.Logf("nAckTimeouts: %d\n", a1.stats.getNumAckTimeouts())

assert.Equal(t, uint64(4), a1.stats.getNumDATAs(), "DATA chunk count mismatch")
assert.True(t, a0.stats.getNumSACKs() < a1.stats.getNumDATAs(), "sack count should less than data")
assert.Equal(t, uint64(0), a1.stats.getNumAckTimeouts(), "ackTimeout count mismatch")
assert.Equal(t, uint64(0), a0.stats.getNumT3Timeouts(), "should be no retransmit")

closeAssociationPair(br, a0, a1)
})
}

func TestAssocReset(t *testing.T) {
Expand Down

0 comments on commit 9119023

Please sign in to comment.