Skip to content

Commit

Permalink
add bash stress test to debug for #6259
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww committed Jan 15, 2025
1 parent fa6792e commit 2dd420e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/runtime/test_bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,3 +783,24 @@ def test_python_interactive_input(temp_dir, runtime_cls, run_as_openhands):
assert '[The command completed with exit code 0.]' in obs.metadata.suffix
finally:
_close_test_runtime(runtime)


def test_stress_long_output(temp_dir, runtime_cls, run_as_openhands):
runtime = _load_runtime(temp_dir, runtime_cls, run_as_openhands)
try:
# Run a command that generates long output multiple times
for i in range(100):
action = CmdRunAction(
'for j in $(seq 1 1000); do echo "Line $j - Iteration $i"; done'
)
action.timeout = 30
obs = runtime.run_action(action)
logger.info(f'Completed iteration {i}', extra={'msg_type': 'DEBUG'})

# Verify the output
assert obs.exit_code == 0
assert f'Line 1 - Iteration {i}' in obs.content
assert f'Line 1000 - Iteration {i}' in obs.content
assert '[The command completed with exit code 0.]' in obs.metadata.suffix
finally:
_close_test_runtime(runtime)

0 comments on commit 2dd420e

Please sign in to comment.