Open codeboten opened 2 years ago
@codeboten should we add a retry mechanism during the connection? I think the server might not be ready which might have caused this, lmk your opinions.
@sakshi1215 it's possible a retry would solve this, would be good to confirm that's the root cause first. Another thing that may be causing issues is if the port is being re-used by multiple tests.
Just hit this in https://github.com/open-telemetry/opentelemetry-collector/pull/6423 as well. I could recreate it by running this test multiple times with -test.count=100
. And it does seems that the server was not ready yet (it gets started in a go routine, so very possible), we could possibly use assert.Eventually
here and check if we can still recreate this failure.
Also agree that we should avoid using a static port here and instead getting an available one.
See the failure: https://github.com/open-telemetry/opentelemetry-collector/actions/runs/3362867290/jobs/5575186303#step:6:4285