Skip to content

ci: increase go test timeout from 5m to 10m in test command#55

Merged
erraggy merged 1 commit intomainfrom
fix/go-test-timeout
Nov 29, 2025
Merged

ci: increase go test timeout from 5m to 10m in test command#55
erraggy merged 1 commit intomainfrom
fix/go-test-timeout

Conversation

@erraggy
Copy link
Copy Markdown
Owner

@erraggy erraggy commented Nov 29, 2025

Summary

Fixes the actual root cause of the Go workflow test timeouts.

Problem

PR #54 increased the job-level timeout-minutes from 5 to 10, but the tests were still timing out after ~47 seconds. This is because the go test command itself has a -timeout=5m flag that takes precedence.

Looking at line 33 of .github/workflows/go.yml:

run: go test -v -coverprofile=coverage.txt -covermode=atomic -timeout=5m -parallel=4 ./...

The -timeout=5m flag tells Go's test runner to kill tests after 5 minutes, regardless of the GitHub Actions job timeout.

Solution

Change -timeout=5m to -timeout=10m in the go test command to match the job-level timeout.

Why This Matters

Without this fix:

  • Module download: ~2-3 minutes
  • Test execution starts but hits 5-minute timeout before completion
  • Total: Test fails at ~5 minutes even though job allows 10 minutes

With this fix:

  • Module download: ~2-3 minutes
  • Test execution: ~2-3 minutes
  • Total: ~5-7 minutes (within 10-minute limit)
  • Cached runs: Still complete in ~30 seconds

Testing

The tests themselves don't have any hangs - they just need more time on first runs when downloading dependencies. Local runs complete successfully in ~30 seconds with warm cache.

The previous fix (PR #54) increased the job-level timeout but the actual
go test command still had -timeout=5m which was causing tests to timeout
after ~47 seconds when hitting the 5-minute limit.

This changes the -timeout flag in the go test command from 5m to 10m to
match the job-level timeout and allow tests to complete.
Copilot AI review requested due to automatic review settings November 29, 2025 06:03
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.52%. Comparing base (b5dd575) to head (7592ba4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #55   +/-   ##
=======================================
  Coverage   66.52%   66.52%           
=======================================
  Files          42       42           
  Lines        7795     7795           
=======================================
  Hits         5186     5186           
  Misses       2070     2070           
  Partials      539      539           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes test timeouts in the GitHub Actions CI workflow by increasing the go test timeout flag from 5 minutes to 10 minutes, aligning it with the job-level timeout that was previously increased in PR #54. The change ensures that tests have sufficient time to complete on first runs when downloading dependencies, while cached runs still complete quickly (~30 seconds).

Key Changes

  • Updated go test -timeout flag from 5m to 10m in the main CI workflow
  • Ensures consistency between the test-level timeout and the job-level timeout (both now 10 minutes)

@erraggy erraggy merged commit 809a1de into main Nov 29, 2025
13 checks passed
@erraggy erraggy deleted the fix/go-test-timeout branch November 29, 2025 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants