Skip to content

Commit

Permalink
Misc test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mafredri committed Aug 2, 2022
1 parent 62f50b7 commit a0a2c67
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,7 @@ func TestAssocReset(t *testing.T) {
_, _, err = s0.ReadSCTP(buf)
assert.Equal(t, io.EOF, err, "should be EOF")
doneCh <- err
return
}
}()

Expand Down Expand Up @@ -2841,6 +2842,15 @@ func TestAssociation_Abort(t *testing.T) {
i, err = s21.Read(buf)
assert.Equal(t, i, 0, "expected no data read")
assert.Error(t, err, "User Initiated Abort: 1234", "expected abort reason")

// Ensure a1 has closed down as well (avoid goroutine leak).
select {
case <-a1.readLoopCloseCh:
case <-time.After(1 * time.Second):
assert.Fail(t, "timed out waiting for a1 read loop to close")
}

time.Sleep(time.Millisecond) // give readLoop a ms to completely exit.
}

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

0 comments on commit a0a2c67

Please sign in to comment.