StefanKopieczek / gossip

SIP stack in Golang
GNU Lesser General Public License v2.1
336 stars 109 forks source link

Fix conntable tests #37

Open rynorris opened 7 years ago

rynorris commented 7 years ago

Conntable uses channels to handle all its updates and stuff. So when we were calling Notify and then immediately checking the outcome, it was hit-and-miss whether it would have been correctly created or not. Similarly, when we called timing.Elapse right after, sometimes the timer hadn't yet been created, so the expiry tests were failing sporadically.

This PR changes all the conntable tests to use testutils.Eventually to check our assumptions about the connections being properly registered before continuing with the test.