Open natebrennand opened 2 years ago
Hrm, I understand why this could be a problem, but I'm not seeing it locally. We also run these tests daily and not seeing any issues: https://github.com/twilio/twilio-oai-generator/blob/11aa70dd14b66c96ca9aa2fc573696e10f6e1f9c/.github/workflows/test.yml#L38
Is there some other piece that I'm missing which is causing the failure for you?
Is there some other piece that I'm missing which is causing the failure for you?
My best guess is my local environment contributes to it? I've got a souped up M1 Max and 1gb fiber.
AIUI, this failure only occurs if examples/go-client/Dockerfile
can execute those steps and start the tests before the prism
container is ready to start requests.
The go-client test execution might never win the race in an environment with some combination of:
In this past execution, you can see that this race was narrowly lost, Prism starts up ~6s before the tests start executing: https://github.com/twilio/twilio-oai-generator/runs/5561494883?check_suite_focus=true#step:6:10273 (I had to link to an older build because these logs aren't included in recent runs after the move to daemon mode for docker-compose)
Makes sense, will take a look at the PR.
Issue Summary
When running
make test-docker
locally, the first test executed by Go,TestGet
, failed reliably.When inspecting the logs from
docker-compose
, the Prism startup output was emitted long after the go tests executed and failed. This makes me suspect that what I'm encountering is a startup issue where the Prism container isn't ready to accept requests before the go tests begin. Mitigation suggestions are here: https://docs.docker.com/compose/startup-order/Steps to Reproduce
make test-docker
docker-compose logs -f
fromexamples/prism/
to see log outputException/Log
I added a log to better inspect the error occurring:
Which then yielded this error:
prism-go-client-test-1 | {"Time":"2022-04-18T18:49:46.703409863Z","Action":"output","Package":"go-client/helper/rest/api/v2010","Test":"TestGet","Output":" api_test.go:31: err: Get \"http://prism_twilio:4010/v1/Credentials/AWS\": dial tcp 172.24.0.2:4010: connect: connection refused\n"}
Technical details:
main
)