Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify ssh box to fix multi-line command issues and add unit tests #1432

Closed
wants to merge 13 commits into from

Conversation

xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Apr 28, 2024

On the current main branch, running multi-line command through sandbox:

# testing
print('test multi-line command')
exit_code, output = ssh_box.execute("pwd\nls -l\nls -l")
print('exit code:', exit_code)
print(output)

would timeout and/or have issues, since the while loop will be looking for command_output that startswith cmd.

image

This PR:

  • remove those complex logic and fix this issue.
  • add unit tests of single-line & multi-line commands to test

Will resolve #1431

tests/unit/test_sandbox.py Outdated Show resolved Hide resolved
tests/unit/test_sandbox.py Show resolved Hide resolved
@xingyaoww
Copy link
Collaborator Author

This PR is moved to #1460 since there's a bunch of issue with merge/rebase conflicts so i think it is easier & clenaer to start a new one

@xingyaoww xingyaoww closed this Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add unit tests for sandboxes
4 participants