Description
The runClaudeUpdate test in tests/e2b/claude-runner-integration.test.ts is failing when E2B_API_KEY is available.
Test Location
- File:
tests/e2b/claude-runner-integration.test.ts:60-69
- Test Name:
should update Claude to latest version
Error
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
❯ tests/e2b/claude-runner-integration.test.ts:66:30
64| const result = await runClaudeUpdate(sandbox, logger);
65|
66| expect(result.success).toBe(true);
Root Cause Analysis
The test creates a real E2B sandbox and runs claude update command, expecting it to succeed. The command is returning a non-zero exit code.
Potential causes:
- Claude CLI not properly installed/available in the E2B sandbox template
- The
claude update command failing due to permission issues (npm global install)
- Network issues in the sandbox environment
- The E2B template (
anthropic-claude-code) may have changed
Relevant Code
// src/e2b/claude-runner.ts
export async function runClaudeUpdate(
sandbox: Sandbox,
logger: Logger,
authMethod: 'api-key' | 'oauth' = 'api-key'
): Promise<ClaudeUpdateResult> {
// ... runs 'claude update' command
const result = await sandbox.commands.run(updateCommand, {
timeoutMs: CLAUDE_UPDATE_TIMEOUT_MS
});
const success = result.exitCode === 0;
// ...
}
Proposed Fix Options
- Skip update if already at latest: Check Claude version first, skip update if already current
- Handle update failure gracefully: Mark test as skipped/warning if update fails due to known E2B limitations
- Use specific version check: Instead of running update, verify Claude is installed and accessible
- Update sandbox template expectations: Adjust test expectations based on actual sandbox behavior
Reproduction
E2B_API_KEY=your-key npm test -- tests/e2b/claude-runner-integration.test.ts -t "update Claude" --run
Labels
- bug
- component-e2b
- component-tests
- priority-medium
Description
The
runClaudeUpdatetest intests/e2b/claude-runner-integration.test.tsis failing when E2B_API_KEY is available.Test Location
tests/e2b/claude-runner-integration.test.ts:60-69should update Claude to latest versionError
Root Cause Analysis
The test creates a real E2B sandbox and runs
claude updatecommand, expecting it to succeed. The command is returning a non-zero exit code.Potential causes:
claude updatecommand failing due to permission issues (npm global install)anthropic-claude-code) may have changedRelevant Code
Proposed Fix Options
Reproduction
Labels