Repository navigation
test(agentstudio-sandbox): add extensive hardening and validation tests - #262
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Component(s) Affected
Checklist
Testing
[How to test these changes]
Additional Notes
[Optional: any other context]