fix: resolve test failures on Linux
- Wrap hostFs.ReadDir error to include "failed to read directory" prefix, matching the assertion in TestFilesystemTool_ListDir_NotFound - Replace shell command substitution in TestExecTool_Bg_RingBufferOverflow to avoid triggering denyPatterns safety guard Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2c00e4537f
commit
36b4863ce0
2 changed files with 6 additions and 2 deletions
|
|
@ -273,7 +273,11 @@ func (h *hostFs) ReadFile(path string) ([]byte, error) {
|
|||
}
|
||||
|
||||
func (h *hostFs) ReadDir(path string) ([]os.DirEntry, error) {
|
||||
return os.ReadDir(path)
|
||||
entries, err := os.ReadDir(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read directory: %w", err)
|
||||
}
|
||||
return entries, nil
|
||||
}
|
||||
|
||||
func (h *hostFs) WriteFile(path string, data []byte) error {
|
||||
|
|
|
|||
|
|
@ -844,7 +844,7 @@ func TestExecTool_Bg_RingBufferOverflow(t *testing.T) {
|
|||
if runtime.GOOS == "windows" {
|
||||
cmd = "1..2000 | ForEach-Object { Write-Output ('x' * 50) }; Start-Sleep -Seconds 30"
|
||||
} else {
|
||||
cmd = "for i in $(seq 1 2000); do echo $(head -c 50 /dev/zero | tr '\\0' 'x'); done; sleep 30"
|
||||
cmd = "yes 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | head -n 2000; sleep 30"
|
||||
}
|
||||
|
||||
result := tool.Execute(context.Background(), map[string]any{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue