MCPcopy Create free account
hub / github.com/astercloud/aster / TestBashTool_ConcurrentExecution

Function TestBashTool_ConcurrentExecution

pkg/tools/builtin/bash_test.go:279–304  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestBashTool_ConcurrentExecution(t *testing.T) {
280 tool, err := NewBashTool(nil)
281 if err != nil {
282 t.Fatalf("Failed to create Bash tool: %v", err)
283 }
284
285 concurrency := 5
286 result := RunConcurrentTest(concurrency, func() error {
287 input := map[string]any{
288 "command": "echo 'Concurrent test'",
289 }
290 result := ExecuteToolWithInput(t, tool, input)
291 if !result["ok"].(bool) {
292 return errors.New("Tool execution failed")
293 }
294 return nil
295 })
296
297 if result.ErrorCount > 0 {
298 t.Errorf("Concurrent bash execution failed: %d errors out of %d attempts",
299 result.ErrorCount, concurrency)
300 }
301
302 t.Logf("Concurrent bash execution completed: %d success, %d errors in %v",
303 result.SuccessCount, result.ErrorCount, result.Duration)
304}
305
306func TestBashTool_DifferentShellTypes(t *testing.T) {
307 tool, err := NewBashTool(nil)

Callers

nothing calls this directly

Calls 3

NewBashToolFunction · 0.85
RunConcurrentTestFunction · 0.85
ExecuteToolWithInputFunction · 0.85

Tested by

no test coverage detected