destroy sessions when deleting them from the packet handler map

This commit is contained in:
Marten Seemann 2019-09-24 20:32:53 +07:00
parent 03483d5e71
commit da0288b273
2 changed files with 6 additions and 1 deletions

View file

@ -137,7 +137,9 @@ var _ = Describe("Packet Handler Map", func() {
It("deletes retired session entries after a wait time", func() {
handler.deleteRetiredSessionsAfter = scaleDuration(10 * time.Millisecond)
connID := protocol.ConnectionID{1, 2, 3, 4, 5, 6, 7, 8}
handler.Add(connID, NewMockPacketHandler(mockCtrl))
sess := NewMockPacketHandler(mockCtrl)
handler.Add(connID, sess)
sess.EXPECT().destroy(gomock.Any())
handler.Retire(connID)
time.Sleep(scaleDuration(30 * time.Millisecond))
handler.handlePacket(nil, nil, getPacket(connID))