Repository navigation
Fix as.sh version selection and startup reliability - #3271
Merged
hengyunabc merged 2 commits intoSep 28, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Concurrent installation can remove another launcher's completed installation, causing startup failure or fallback.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Improves as.sh version selection, cache validation, download reliability, and telnet handling.
Changes:
- Adds numeric version selection and validates cached installations.
- Adds bounded, failure-aware downloads with fallback behavior.
- Adds Bash launcher regression tests.
| File | Description |
|---|---|
bin/as.sh |
Hardens version lookup, installation, and startup behavior. |
boot/src/test/java/com/taobao/arthas/boot/AsScriptTest.java |
Adds launcher regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| @Before | ||
| public void setUp() throws Exception { | ||
| Assume.assumeTrue("Bash launcher tests require a Unix shell", File.separatorChar == '/'); |
Comment on lines
+262
to
+266
| for (String request : requests) { | ||
| assertTrue(request, request.contains("--fail")); | ||
| assertTrue(request, request.contains("--connect-timeout")); | ||
| assertTrue(request, request.contains("--max-time")); | ||
| } |
Comment on lines
+111
to
+116
| @Test | ||
| public void choosesNewestNumericCachedVersion() throws Exception { | ||
| cache("4.3.9"); | ||
| Path newest = cache("4.3.10"); | ||
| assertHome(run(0, "--attach-only", "1234"), newest); | ||
| } |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Same-version installations remain racy, and Cygwin/MinGW can still attach before rejecting an unusable telnet client.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


as.shcould select4.3.9over4.3.10, treat incomplete cache directories as installed versions, and reject attach-only or batch sessions when telnet was absent. Version lookups also had no timeout, while archive downloads did not fail on HTTP errors.Added 18 launcher regression tests in the existing boot JUnit module. They exercise the Bash startup flow and real ZIP extraction with isolated curl/Java/process fixtures, without network access or attaching to a real JVM.
Local validation on macOS with Bash 3.2: