codecov / codecov-bash

Global coverage report uploader for Codecov
https://codecov.io
Apache License 2.0
234 stars 155 forks source link

connect-timeout of 2 seconds is too small and causes report uploads to fail #379

Closed jleoirab closed 3 years ago

jleoirab commented 3 years ago

When using the bash uploader I have noticed that I get timeout exceptions because of the --connect-timeout value set for the "ping" curl command to get the bucket URL.

res=$(curl $curl_s -X POST $curlargs $cacert \
          --retry 5 --retry-delay 2 --connect-timeout 2 \
          -H 'X-Reduced-Redundancy: false' \
          -H 'X-Content-Type: application/x-gzip' \
          "$url/upload/v4?$query" || true)

I can never successfully upload reports from my CI pipeline because the 2 seconds timeout is too small. I was able to successfully get the uploader script to work by increasing the timeout.

I considered overriding the default 2-second timeout using the curlargs option but because my provided value is applied first, curl still uses the default set by the script.

Is it possible to provide the option for this? Or apply curlargs after the default values set in the script?

Thanks.

jleoirab commented 3 years ago

💯 Thanks for looking into this