fix(install): sort failed installations for deterministic error output#7936
fix(install): sort failed installations for deterministic error output#7936
Conversation
With parallel tool installation, failures complete in arbitrary order. This caused test_error_display to fail intermittently because the error message listed tools in completion order rather than a consistent order. Sort failed tools alphabetically in the error message to ensure deterministic output regardless of parallel execution order. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
This PR fixes intermittent test failures by ensuring deterministic error output when multiple tool installations fail. With parallel tool installation, failed tools could complete in any order, causing test_error_display to fail when the actual error message didn't match the expected order.
Changes:
- Sort failed tool installations alphabetically before formatting error messages
- Update test expectations to reflect the new alphabetical ordering
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/errors.rs | Implements alphabetical sorting of failed installations before generating error output |
| e2e/cli/test_error_display | Updates expected error message to match new alphabetical ordering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let mut sorted_failures: Vec<_> = failed_installations | ||
| .iter() | ||
| .map(|(tr, err)| (format!("{}@{}", tr.ba().full(), tr.version()), err)) | ||
| .collect(); |
There was a problem hiding this comment.
The tool name string is formatted twice: once here for sorting and again in the original loop. Consider storing the formatted string once to avoid redundant string allocations and formatting operations.
- Sort failed installations alphabetically for deterministic output (from #7936) - Add cargo-machete ignore for serde_json build dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.1.12 x -- echo |
20.7 ± 0.3 | 19.8 | 22.6 | 1.00 |
mise x -- echo |
20.9 ± 0.4 | 20.2 | 22.8 | 1.01 ± 0.03 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.1.12 env |
20.1 ± 0.6 | 19.4 | 24.7 | 1.00 |
mise env |
20.3 ± 0.5 | 18.9 | 21.6 | 1.01 ± 0.04 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.1.12 hook-env |
20.4 ± 0.4 | 19.6 | 21.6 | 1.00 |
mise hook-env |
20.8 ± 0.6 | 19.8 | 25.0 | 1.02 ± 0.03 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.1.12 ls |
18.2 ± 0.4 | 17.3 | 19.4 | 1.00 |
mise ls |
18.4 ± 0.5 | 17.4 | 20.0 | 1.01 ± 0.03 |
xtasks/test/perf
| Command | mise-2026.1.12 | mise | Variance |
|---|---|---|---|
| install (cached) | 111ms | 111ms | +0% |
| ls (cached) | 71ms | 70ms | +1% |
| bin-paths (cached) | 76ms | 75ms | +1% |
| task-ls (cached) | 535ms | 538ms | +0% |
- Sort failed installations alphabetically for deterministic output (from #7936) - Add cargo-machete ignore for serde_json build dependency Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
### 🚀 Features - **(edit)** add interactive config editor (`mise edit`) by @jdx in [#7930](#7930) - **(lockfile)** graduate lockfiles from experimental by @jdx in [#7929](#7929) - **(task)** add support for usage values in task confirm dialog by @roele in [#7924](#7924) - **(task)** improve source freshness checking with edge case handling by @jdx in [#7932](#7932) ### 🐛 Bug Fixes - **(activate)** preserve ordering of paths appended after mise activate by @jdx in [#7919](#7919) - **(install)** sort failed installations for deterministic error output by @jdx in [#7936](#7936) - **(lockfile)** preserve URL and prefer sha256 when merging platform info by @jdx in [#7923](#7923) - **(lockfile)** add atomic writes and cache invalidation by @jdx in [#7927](#7927) - **(templates)** use sha256 for hash filter instead of blake3 by @jdx in [#7925](#7925) - **(upgrade)** respect tracked configs when pruning old versions by @jdx in [#7926](#7926) ### 🚜 Refactor - **(progress)** migrate from indicatif to clx by @jdx in [#7928](#7928) ### 📚 Documentation - improve clarity on uvx and pipx dependencies by @ygormutti in [#7878](#7878) ### ⚡ Performance - **(install)** use Kahn's algorithm for dependency scheduling by @jdx in [#7933](#7933) - use Aho-Corasick for efficient redaction by @jdx in [#7931](#7931) ### 🧪 Testing - remove flaky test_http_version_list test by @jdx in [#7934](#7934) ### Chore - use github backend instead of ubi in mise.lock by @jdx in [#7922](#7922) ### New Contributors - @ygormutti made their first contribution in [#7878](#7878)
jdx#7936) ## Summary With parallel tool installation (introduced in jdx#7933), failures complete in arbitrary order. This caused `test_error_display` to fail intermittently because the error message listed tools in completion order rather than a consistent order. This PR sorts failed tools alphabetically in the error message to ensure deterministic output regardless of parallel execution order. ## Test plan - [x] `mise run build` succeeds - [x] `mise run lint` passes - [ ] `e2e/cli/test_error_display` passes in CI 🤖 Generated with [Claude Code](https://claude.ai/code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: only changes ordering of multi-tool install failure messages and updates an e2e assertion; no behavior changes beyond formatting. > > **Overview** > Makes multi-tool install failure output deterministic by sorting `failed_installations` by tool name before building the summary list and per-tool error details in `format_install_failures`. > > Updates `e2e/cli/test_error_display` to expect the new sorted ordering in the “invalid configuration” multi-failure case. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 160c509. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
### 🚀 Features - **(edit)** add interactive config editor (`mise edit`) by @jdx in [jdx#7930](jdx#7930) - **(lockfile)** graduate lockfiles from experimental by @jdx in [jdx#7929](jdx#7929) - **(task)** add support for usage values in task confirm dialog by @roele in [jdx#7924](jdx#7924) - **(task)** improve source freshness checking with edge case handling by @jdx in [jdx#7932](jdx#7932) ### 🐛 Bug Fixes - **(activate)** preserve ordering of paths appended after mise activate by @jdx in [jdx#7919](jdx#7919) - **(install)** sort failed installations for deterministic error output by @jdx in [jdx#7936](jdx#7936) - **(lockfile)** preserve URL and prefer sha256 when merging platform info by @jdx in [jdx#7923](jdx#7923) - **(lockfile)** add atomic writes and cache invalidation by @jdx in [jdx#7927](jdx#7927) - **(templates)** use sha256 for hash filter instead of blake3 by @jdx in [jdx#7925](jdx#7925) - **(upgrade)** respect tracked configs when pruning old versions by @jdx in [jdx#7926](jdx#7926) ### 🚜 Refactor - **(progress)** migrate from indicatif to clx by @jdx in [jdx#7928](jdx#7928) ### 📚 Documentation - improve clarity on uvx and pipx dependencies by @ygormutti in [jdx#7878](jdx#7878) ### ⚡ Performance - **(install)** use Kahn's algorithm for dependency scheduling by @jdx in [jdx#7933](jdx#7933) - use Aho-Corasick for efficient redaction by @jdx in [jdx#7931](jdx#7931) ### 🧪 Testing - remove flaky test_http_version_list test by @jdx in [jdx#7934](jdx#7934) ### Chore - use github backend instead of ubi in mise.lock by @jdx in [jdx#7922](jdx#7922) ### New Contributors - @ygormutti made their first contribution in [jdx#7878](jdx#7878)
Summary
With parallel tool installation (introduced in #7933), failures complete in arbitrary order. This caused
test_error_displayto fail intermittently because the error message listed tools in completion order rather than a consistent order.This PR sorts failed tools alphabetically in the error message to ensure deterministic output regardless of parallel execution order.
Test plan
mise run buildsucceedsmise run lintpassese2e/cli/test_error_displaypasses in CI🤖 Generated with Claude Code
Note
Low Risk
Low risk: only changes ordering of multi-tool install failure messages and updates an e2e assertion; no behavior changes beyond formatting.
Overview
Makes multi-tool install failure output deterministic by sorting
failed_installationsby tool name before building the summary list and per-tool error details informat_install_failures.Updates
e2e/cli/test_error_displayto expect the new sorted ordering in the “invalid configuration” multi-failure case.Written by Cursor Bugbot for commit 160c509. This will update automatically on new commits. Configure here.