(no title)
duckydude20 | 2 years ago
i know this is not the best way. but i added a timeout of 10sec. also while asserting i am polling to know if i got a connection.
i understand and i can make it way better. but for now it's good enough. more importantly, it's better not scatter these kind of codes everywhere. also making things explicit is better always. like now server.Start is Blocking. and in my tests i am spawning a goroutine, rather than it doing implicitly.
another thing, testing dependencies. i am going to test concurrent handler. and it's not dependent on tls or tcp. i can just use a fake and test the concurrency. i like this design. scattering these throughout will make every other test integration tests. increasing time to execute and that is bad.
btw, it would have been better if go lang runs tests in parallel.
No comments yet.