Repository navigation
test: fix Group A deterministic test-suite failures (#1260) - #1272
Merged
Merged
Conversation
Test-side fixes for the always-failing items surfaced by the full-suite run (no product changes): - test_cb_probe_execution_close.py: _restore_complete_stubs referenced an unbound _sanitizer_mod → NameError at setup for all 10 tests. Bind it at module level from _install_sanitizer_stub() (now returns the complete stub). - test_s7_reserve_instance_id.py: the _FlakyDb mock raised sqlite3.IntegrityError, but reserve_and_generate_instance_id catches sqlalchemy.exc.IntegrityError (db.create_git_config goes through the SQLAlchemy engine, #300), so the retry path never triggered. Raise sqlalchemy.exc.IntegrityError (wrapping the sqlite3 one). Verified prod's except is correct — not widened. - test_platform_default_model.py: `import src.backend.services.settings_service` → `import services.settings_service` (package-relative, ModuleNotFoundError for 'src' when run from tests/). - test_activities.py: timeline trigger-value set now includes "loop" (#740/#1150) and "voip" (#1056). (Group A "stale lint baseline" item is already green on dev — no change needed.) Validated: test_s7 retry test passes; cb_probe + platform_default_model collect clean (NameError / ModuleNotFound gone); lint_sys_modules green. Related to #1260 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
15 tasks
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
Fixes the Group A (deterministic, clearly test-side) failures from #1260. No product changes — these are fixture/import/stale-assertion bugs.
test_cb_probe_execution_close.py_restore_complete_stubsreferenced an unbound_sanitizer_mod→NameErrorat setup for all 10 tests. Bind it module-level from_install_sanitizer_stub()(now returns the stub).tests/git-sync/test_s7_reserve_instance_id.py_FlakyDbraisedsqlite3.IntegrityError, butreserve_and_generate_instance_idcatchessqlalchemy.exc.IntegrityError(db goes through the SQLAlchemy engine, #300) so the retry never fired. Raisesqlalchemy.exc.IntegrityErrorwrapping the sqlite3 one. Verify-first done:db.create_git_configusesget_engine().begin(), so the wrapped exception is what escapes — prod'sexceptis correct, not widened.test_platform_default_model.pyimport src.backend.services.settings_service→import services.settings_service(package-relative;ModuleNotFoundError: 'src'when run fromtests/).test_activities.pyloop(#740/#1150) andvoip(#1056).dev(216/237, no new violations) — no change needed.Validation
test_db_insert_failure_triggers_retry): passes.NameErrorandModuleNotFoundErrorgone (the remainingConnectErrors are conftest fixtures needing a live backend, the out-of-scope harness issue noted in Fix test-suite bugs surfaced by full integration run (fixture NameError, stale mocks, env-coupled assertions, isolation, flakes) #1260, run in CI against the live stack).lint_sys_modulesgreen.Scope: Group A only (deterministic). Groups B (env-coupled), C (isolation), D (flaky) intentionally left for follow-up.
Related to #1260