test: add 12 integration tests covering identified coverage gaps#2845
Merged
markphelps merged 6 commits intomainfrom Mar 17, 2026
Merged
test: add 12 integration tests covering identified coverage gaps#2845markphelps merged 6 commits intomainfrom
markphelps merged 6 commits intomainfrom
Conversation
…rtions - ! curl now writes response body to stderr for error body assertions - webhookResult captures ErrorMessage string for failed prediction webhook tests
…or errors, sys.exit - prediction_error_response: verify JSON shape for ValueError/RuntimeError/Exception - nested_output_types: BaseModel-in-BaseModel, List[BaseModel], Optional nested fields - iterator_error_midstream: generator yields then raises, webhook captures failure - predict_sys_exit: sys.exit() fails prediction but worker survives for next request
…k failure, SIGTERM - TestConcurrentAboveLimit: 409 when exceeding max_concurrency - TestSIGTERMDuringSetup: clean shutdown when SIGTERM arrives during setup - sequential_state_leak: documents module-level state persistence across calls - webhook_delivery_failure: server stays healthy when webhook URL is unreachable - webhook_prediction_error: failed prediction webhook payload has error fields
…ync generator - build_openapi_schema_complex: constraints, choices, Secret, Optional, BaseModel output - coglet_large_file_upload_serial: 50 MiB binary file through upload URL pipeline - async_generator_precollect: verify async generator output is pre-collected
…dstream nested_output_types: rewrite test to use supported types only. Cog's type system does not support nested BaseModel fields (FieldType.from_type raises ValueError for custom types without a Coder). Test now covers multiple primitive types, Optional, and List[str] in a flat BaseModel. iterator_error_midstream: fix webhook harness Output field type. The webhook payload's output field is a JSON array for iterator predictions (not a string), causing json.Decode to fail with UnmarshalTypeError. The harness returned 400, coglet gave up (400 is not retryable), and the test hung forever. Changed Output from string to json.RawMessage to handle both string and array outputs.
- Fix TestSIGTERMDuringSetup sending SIGINT instead of SIGTERM (use syscall.SIGTERM) - Replace 500ms sleep race in TestConcurrentAboveLimit with polling retry for 409 - Replace 3s sleep race in TestSIGTERMDuringSetup with health-check polling for STARTING status - Strengthen predict_time assertion in async_generator_precollect to verify numeric value - Add comment explaining regex dot-as-quote workaround in sequential_state_leak
Contributor
Author
Code Review FixesPushed Fixed
Not changing
|
michaeldwan
approved these changes
Mar 17, 2026
Member
michaeldwan
left a comment
There was a problem hiding this comment.
looks good, thanks for the fixes!
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.
Summary
Harness Enhancements
! curlnow writes the HTTP response body to stderr, enabling tests to assert on error response content (e.g., 409 bodies)webhookResultcaptures the actualerror_messagestring (not justhas_errorbool), enabling assertion on failed webhook payloadsNew Tests
prediction_error_responsepredict()raises ValueError/RuntimeError/Exceptionnested_output_typesList[BaseModel], Optional nested fieldsiterator_error_midstreampredict_sys_exitsys.exit()fails prediction but worker survives for next requestTestConcurrentAboveLimitmax_concurrency + 1returns 409 Conflict with capacity errorsequential_state_leakwebhook_delivery_failureTestSIGTERMDuringSetupsetup()causes clean shutdownwebhook_prediction_errorbuild_openapi_schema_complexcoglet_large_file_upload_serialasync_generator_precollectTest Types
integration-tests/tests/(declarative testscript format)integration-tests/concurrent/(require parallel HTTP coordination)How to Run