Skip to content

test: fix Group A deterministic test-suite failures (#1260) - #1272

Merged
vybe merged 1 commit into
devfrom
fix/1260-test-suite-group-a
Jun 19, 2026
Merged

vybe merged 1 commit into
devfrom
fix/1260-test-suite-group-a

Conversation

@dolho

@dolho dolho commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the Group A (deterministic, clearly test-side) failures from #1260. No product changes — these are fixture/import/stale-assertion bugs.

Item File Fix
A1 test_cb_probe_execution_close.py _restore_complete_stubs referenced an unbound _sanitizer_mod → NameError at setup for all 10 tests. Bind it module-level from _install_sanitizer_stub() (now returns the stub).
A2 tests/git-sync/test_s7_reserve_instance_id.py _FlakyDb raised sqlite3.IntegrityError, but reserve_and_generate_instance_id catches sqlalchemy.exc.IntegrityError (db goes through the SQLAlchemy engine, #300) so the retry never fired. Raise sqlalchemy.exc.IntegrityError wrapping the sqlite3 one. Verify-first done: db.create_git_config uses get_engine().begin(), so the wrapped exception is what escapes — prod's except is correct, not widened.
A3 test_platform_default_model.py import src.backend.services.settings_service → import services.settings_service (package-relative; ModuleNotFoundError: 'src' when run from tests/).
A4 test_activities.py Timeline trigger-value set now includes loop (#740/#1150) and voip (#1056).
A5 lint baseline Already green on dev (216/237, no new violations) — no change needed.

Validation

Scope: Group A only (deterministic). Groups B (env-coupled), C (isolation), D (flaky) intentionally left for follow-up.

Related to #1260

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]>

@vybe vybe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validated via /validate-pr: test-only Group A fixes (#1260), targets dev, no product changes, security clean. Approving.

@vybe
vybe merged commit 542d9d6 into dev Jun 19, 2026
16 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