top | item 36478452

(no title)

duckydude20 | 2 years ago

idk, i am new to goland but same thing, tls issue. my tests were very flaky. sometimes they were failing sometimes they weren't. i initially thought it was wsl and goland issue. but after it happened 2-3 times. i ran with goroutines test with -count 50 but it didn't work in goland. then i issued in terminal. which i got to see yup my tests are actually flaky.

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.

discuss

order

No comments yet.