Skip to content

test: deflake python venv go backend e2e#10156

Merged
jdx merged 1 commit into
mainfrom
test/deflake-python-venv-go-backend
May 31, 2026
Merged

test: deflake python venv go backend e2e#10156
jdx merged 1 commit into
mainfrom
test/deflake-python-venv-go-backend

Conversation

@jdx

@jdx jdx commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • increase the deadlock regression test watchdog from 60s to a configurable default of 180s
  • run Go cache permission cleanup through an EXIT trap so timed-out runs do not leave read-only files behind

Context

The failing CI run timed out in core/test_python_venv_with_go_backend_deadlock_slow while cold-installing go:github.com/charmbracelet/gum@0.17.0. The test still catches real hangs, but gives ordinary Go module downloads/builds more room.

Verification

  • bash -n e2e/core/test_python_venv_with_go_backend_deadlock_slow
  • shellcheck e2e/core/test_python_venv_with_go_backend_deadlock_slow

Full targeted e2e was attempted locally but did not reach the test because the local build failed first: aws-lc-sys/bindgen could not find libclang.

This PR was generated by an AI coding assistant.


Note

Low Risk
Only changes an e2e shell test timeout and cleanup; no production code paths.

Overview
Deflakes the slow Python-venv + Go-backend deadlock e2e by giving mise install more time on cold CI (default 180s via MISE_E2E_INSTALL_TIMEOUT, was a fixed 60s).

Go module cache cleanup (chmod -R +w ~/go) now runs on EXIT so a timeout kill still leaves the cache writable for teardown instead of only running after a successful run.

Reviewed by Cursor Bugbot for commit a7f2f4a. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the cleanup process in the test_python_venv_with_go_backend_deadlock_slow end-to-end test by introducing a cleanup_go_cache function registered as an EXIT trap and parameterizing the installation timeout. The review feedback suggests making the cleanup function more robust by using '$HOME/go' instead of ~/go and appending '|| true' to the chmod command to prevent potential test failures under set -e.

Comment on lines +10 to +15
cleanup_go_cache() {
# Required to properly cleanup as go installs read-only sources
if [ -d ~/go ]; then
chmod -R +w ~/go
fi
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Since set -euo pipefail is enabled, any failure in the chmod command (for example, if files are concurrently modified or if there are permission restrictions) will cause the cleanup function to exit with an error. In an EXIT trap, this can result in the entire script exiting with a non-zero status, causing false-positive test failures in CI.

Additionally, using "$HOME/go" is more robust and standard in shell scripts than the unquoted tilde ~/go.

Consider appending || true to the chmod command and using "$HOME/go".

cleanup_go_cache() {
  # Required to properly cleanup as go installs read-only sources
  if [ -d "$HOME/go" ]; then
    chmod -R +w "$HOME/go" || true
  fi
}

@greptile-apps

greptile-apps Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR deflakes the Python venv + Go backend deadlock e2e test by giving cold Go module downloads more room to finish and ensuring the go-cache write-permission cleanup runs even when the test is cut short by a timeout.

  • The hardcoded 60 s timeout is replaced with a configurable MISE_E2E_INSTALL_TIMEOUT variable (default 180 s), matching the observed CI failure where a cold gum@0.17.0 build exceeded the old limit.
  • The trailing chmod -R +w ~/go that only ran on success is promoted to an EXIT trap, so read-only Go source files are cleaned up regardless of how the script exits (timeout, assertion failure, or success).

Confidence Score: 5/5

This is a small, targeted e2e test fix with no production code changes; the two modifications are straightforward and correct.

The EXIT trap correctly fires when set -e terminates the shell after timeout kills mise install, so the go-cache cleanup now runs in all exit paths. The timeout variable is safely quoted and defaults to a reasonable value. No logic from the original test is altered.

No files require special attention.

Important Files Changed

Filename Overview
e2e/core/test_python_venv_with_go_backend_deadlock_slow Moves go cache cleanup to an EXIT trap and makes the install timeout configurable via MISE_E2E_INSTALL_TIMEOUT (default 180s, up from 60s)

Reviews (1): Last reviewed commit: "test: deflake python venv go backend e2e" | Re-trigger Greptile

@jdx jdx merged commit 61a27f7 into main May 31, 2026
22 checks passed
@jdx jdx deleted the test/deflake-python-venv-go-backend branch May 31, 2026 04:01
@github-actions

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.16 x -- echo 22.5 ± 0.4 21.7 24.2 1.00 ± 0.03
mise x -- echo 22.4 ± 0.4 21.6 25.1 1.00

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.16 env 22.1 ± 0.9 21.2 29.3 1.01 ± 0.04
mise env 21.9 ± 0.4 21.1 26.0 1.00

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.16 hook-env 22.8 ± 0.4 22.1 24.4 1.00
mise hook-env 23.0 ± 1.1 22.1 38.7 1.01 ± 0.05

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.5.16 ls 19.3 ± 0.4 18.6 24.3 1.01 ± 0.02
mise ls 19.1 ± 0.3 18.5 21.0 1.00

xtasks/test/perf

Command mise-2026.5.16 mise Variance
install (cached) 171ms 167ms +2%
ls (cached) 86ms 84ms +2%
bin-paths (cached) 89ms 86ms +3%
task-ls (cached) 157ms 155ms +1%

This was referenced May 31, 2026
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.

1 participant