Skip to content

test(agentstudio-sandbox): add extensive hardening and validation tests - #262

Merged
lzsweb merged 7 commits into
mainfrom
dev/2.1.5-1
Dec 4, 2026
Merged

lzsweb merged 7 commits into
mainfrom
dev/2.1.5-1

Conversation

@luk384090-cloud

Copy link
Copy Markdown
Collaborator
  • Introduce comprehensive coverage for Sandbox validation, transport, facets and Web UI
  • Add input validation tests for resource IDs, URLs, filenames, durations, and bounded streams
  • Enhance transport layer tests including handling of timeouts, error mapping, API key redaction
  • Implement template lifecycle tests covering creation, update, deletion, and readiness polling
  • Cover Sandbox lifecycle operations: create, pause, resume, release and connection status validation
  • Add signed upload ticket workflow tests with upload content and completion verification
  • Include Harness Agents launch, operation failure, connect prerequisites and error cases
  • Test safe handling of SSE framing, polling timeouts, upload limits, and preview resource ownership
  • Validate error propagation and mapping for asynchronous operations and HTTP interactions

Description

[Describe what this PR does and why]

Related Issue: Fixes #[issue_number] or Relates to #[issue_number]

Security Considerations: [Check if API keys or sensitive credentials are exposed in code/logs]

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Model
  • Application
  • Common
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

luk384090-cloud and others added 7 commits December 4, 2026 12:39
- Introduce comprehensive coverage for Sandbox validation, transport, facets and Web UI
- Add input validation tests for resource IDs, URLs, filenames, durations, and bounded streams
- Enhance transport layer tests including handling of timeouts, error mapping, API key redaction
- Implement template lifecycle tests covering creation, update, deletion, and readiness polling
- Cover Sandbox lifecycle operations: create, pause, resume, release and connection status validation
- Add signed upload ticket workflow tests with upload content and completion verification
- Include Harness Agents launch, operation failure, connect prerequisites and error cases
- Test safe handling of SSE framing, polling timeouts, upload limits, and preview resource ownership
- Validate error propagation and mapping for asynchronous operations and HTTP interactions
…ility

- Mark websocket sockets with dashscope_interrupted flag on interrupt to avoid race conditions
- Close sockets on Windows after shutdown to unblock blocked recv/send calls
- Treat OSError as EOF during recv_event when socket was interrupted on Windows
- Adjust timing assertions in audio live session tests to account for Windows timer resolution
- Add conditional test skips and assertions in tests to handle Windows-specific socket behavior
- Silence benign socket errors waking readers after socket closure on Windows
- Fix environment variable mocks in tests to handle Windows USERPROFILE for expanduser()
- Normalize line endings in CLI tests for Windows stdout differences
- Set SO_RCVBUF on peer socket to 1024 bytes to disable Windows autotuning of
  the receive buffer
- Ensure backpressure applies consistently across platforms during tests
- Applied change in both test_audio_live_session.py and test_audio_ws_session.py
- Prevent payload absorption over loopback by explicit receive window setting
- Introduce _fill_until_send_blocks() utility in audio live and ws session tests
- Ensure socket pairs are filled to create backpressure on all platforms
- Replace explicit SO_RCVBUF settings with empirical send fill for reliable blocking
- Improve test reliability on Windows where receive window autotunes upward
- Use timeout-based send blocking to simulate backpressure conditions
- Add extension-to-Content-Type mapping matching Java SDK's behavior
- Implement _guess_mime_type function to infer MIME type by filename suffix
- Use guessed MIME type as default instead of application/octet-stream
- Update upload calls to use the guessed MIME type when not explicitly set
- Add comprehensive unit tests for MIME guessing with sync and async clients
- Handle named streams by guessing MIME type from their name attribute
- Ensure uploads with explicit MIME types override the guessed value
- Fix backpressure test assertions to handle platform-specific socket behavior
Cover close acknowledgements and deadline interrupts, synchronize active-response disconnect tests, and document Harness launch and release waits.
@lzsweb
lzsweb merged commit 6ecd574 into main Dec 4, 2026
13 checks passed
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.

2 participants