fix(#936): refresh stale test expectations for #665, #898, #474 - #940
Merged
Conversation
Several integration tests were asserting pre-change behaviour: - tests/test_agent_timeout.py — default execution_timeout_seconds was raised from 900 → 3600 in #665. Rename test_get_timeout_default_is_900 and update the expected value. - tests/integration/test_monitoring_service.py — /health-specific override in monitoring_service.py treats ReadTimeout, ReadError, and PoolTimeout as agent liveness signals and DOES record_failure() on the per-agent circuit. Rename the three `_does_not_record_` tests to `_records_failure` and flip the assertion from 0 → 1. The docstrings now point at the explicit /health-specific handlers rather than the unrelated TRANSIENT_TRANSPORT_EXCEPTIONS contract. - tests/test_agent_files.py — POST /api/agents/{name}/files/mkdir (#898) is the first test in the file that requires the agent container to be visible to the backend Docker SDK before the request, not just the row marked status=running. Add a small _wait_for_container_ready helper that polls /files until the container is visible (probe returns anything other than 404) and call it in the two TestCreateFolder tests that actually hit the endpoint (test_create_folder_and_list, test_create_folder_duplicate_returns_409). The other three tests in the class fail-fast before the container check (deny-list 403, nonexistent-agent 404, unauth 401) and don't need the wait. No production code changes — tests only.
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.
Closes #936.
Summary
test_get_timeout_default_is_900→test_get_timeout_default_is_3600(default raised in feat: increase default chat execution timeout from 15m to 60m #665).TestCheckNetworkHealthClassification: renametest_{read_timeout,read_error,pool_timeout}_does_not_record→..._records_failureand flip the assertion to== 1./healthprobes treat these exceptions as agent-liveness signals and DO record on the circuit (override ofTRANSIENT_TRANSPORT_EXCEPTIONS).TestCreateFolder: add a small_wait_for_container_readyhelper that polls until the agent container is visible to the backend's Docker SDK, and call it from the two tests that actually hitPOST /files/mkdir(feat(files): create folder in File Manager (#37) #898). The other three tests in the class fail-fast before the container lookup and don't need the wait.No production code changes — tests only.
Test plan
tests/test_watchdog.py::TestTwoCycleOrphanConfirmation— 3/3 pass (already correct after fix(#921): watchdog orphan race + CB dormant self-heal + admin reset #924; left untouched).tests/integration/test_monitoring_service.py::TestCheckNetworkHealthClassification::test_{read_timeout,read_error,pool_timeout}_records_failure— 3/3 pass.tests/test_agent_timeout.py::TestTimeoutGet::test_get_timeout_default_is_3600— pass.tests/test_agent_files.py::TestCreateFolder::test_create_folder_and_list— pass (after rebuildingtrinity-agent-baseto include feat(files): create folder in File Manager (#37) #898's mkdir endpoint).tests/test_subscription_auto_switch.py::TestAutoSwitchSetting::test_get_auto_switch_default_on— passes against current dev (no change needed; the runtime default still resolves to True per Lower subscription auto-switch threshold to 1 failure and broaden to auth errors #441).Note:
tests/integration/test_monitoring_service.pyrequiresREDIS_URLto be exported beforepyteststarts (the module setslocalhost:6379at import time, buttests/conftest.pypre-loadsservices.agent_clientfirst, which capturesconfig.REDIS_URL). Pre-existing setup quirk, not introduced here.