Fix malformed imports in helper_m1_e2e_verification.py and
helper_m4_e2e_cli.py where 'from helpers_common import reset_global_state'
was incorrectly inserted inside a parenthesized import block, causing
Python syntax errors and breaking the lint and unit_tests CI gates.
Also fix import ordering in helper_m2_e2e_verification.py,
helper_m5_e2e_context.py, helper_m5_e2e_support.py, and
helper_m5_e2e_verification.py to satisfy ruff I001 import-sort rules
by placing helpers_common imports in the correct group alongside other
local robot/ helper imports.
ISSUES CLOSED: #8459
- Add NO_COLOR=1 to E2E Suite Setup and Test Environment to prevent
Rich from injecting ANSI escape codes into JSON output, which breaks
Extract JSON From Stdout and JSON assertions in M5/WF14 acceptance tests.
- Add reset_global_state() calls to all M1/M2/M4/M5 E2E verification
helpers to clear Settings singleton, DI container, provider registry,
and SQLAlchemy engine cache between parallel pabot worker runs.
- Propagate NO_COLOR=1 at suite-setup level in E2E and integration
test resource files so all Run Process subprocesses inherit clean
terminal output mode.
Root causes:
1. Missing NO_COLOR=1 caused Rich ANSI codes in CLI JSON output,
making json.loads() failures in robot Extract JSON From Stdout
2. Stale Settings singleton carried provider keys and DB paths between
pabot workers, causing UNIQUE constraint violations and stale config
lookups in context policy and server mode E2E tests.
Related: PR #9912