diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bff068..e027fd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,7 @@ jobs: env: CODSPEED_GO_PKG_VERSION: ${{ github.head_ref || github.ref_name }} with: + runner-version: branch:cod-2057-perf-timeout-in-codspeed-go-makes-benchmark-hang mode: walltime working-directory: example run: cargo r --release --manifest-path ../go-runner/Cargo.toml -- test -bench=. ${{ matrix.target }} diff --git a/example/helper.go b/example/helper.go index 5ee6592..567c7e7 100644 --- a/example/helper.go +++ b/example/helper.go @@ -19,7 +19,7 @@ func expensiveOperation() uint64 { } // Expensive recursive computation that will dominate flamegraph - fibResult := recursiveFib(30) + fibResult := recursiveFib(15) // More expensive work - sum the data sum := uint64(0) @@ -40,6 +40,6 @@ func doWork(n int) uint64 { func actualWork() uint64 { time.Sleep(1 * time.Millisecond) - result := doWork(30) + result := doWork(15) return 42 + result } diff --git a/go-runner/src/runner/mod.rs b/go-runner/src/runner/mod.rs index c435a27..3d535d2 100644 --- a/go-runner/src/runner/mod.rs +++ b/go-runner/src/runner/mod.rs @@ -23,6 +23,11 @@ fn run_cmd>( let mut cmd = Command::new(go_binary); cmd.args([ "test", + // Disable stripping of symbols and debug information + "-ldflags=-s=false -w=false", + // Keep the test binary on disk after executing it. This is required by + // the runner to properly parse the symbols and debug info. + "-work", "-overlay", &overlay_file.to_string_lossy(), "-bench",