molecule-core/workspace/tests
Hongming Wang 5b5eacbb29 test(inbox): clean up daemon poller thread to prevent test cross-talk
test_start_poller_thread_is_daemon spawned a daemon thread with no stop
mechanism — the leaked thread polled every 10ms with the test's patched
httpx.Client mock STILL ACTIVE for ~50ms after the test scope. Later
tests that re-patched httpx.Client + asserted call counts on
fetch_and_stage / Client construction got their assertions inflated by
the leaked thread's iterations.

Symptoms: test_poll_once_skips_chat_upload_row_from_queue saw
fetch_and_stage called twice instead of once on Python 3.11 CI;
test_batch_fetcher_owns_client_when_not_supplied saw two Client
constructions instead of one in the full local suite. Both surfaced
only after Phase 5b's BatchFetcher refactor changed the timing window
that allowed the leaked thread to fire mid-test.

Fix: extend start_poller_thread with an optional stop_event kwarg
(backward compatible — production callers pass None and rely on the
daemon flag for process-exit cleanup). The test now signals + joins
on stop_event before exiting scope, so the thread is gone before any
later test patches httpx.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:47:14 -07:00
..
adapters
snapshots feat(mcp): cross-workspace delegation routing (multi-ws PR-2) 2026-05-04 08:32:24 -07:00
__init__.py
_signature_snapshot.py test(runtime_wedge): module-functions signature snapshot drift gate 2026-04-30 07:01:10 -07:00
conftest.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_a2a_cli.py
test_a2a_client.py feat(a2a-client): surface 410 Gone as 'removed' error so callers can re-onboard (#2429) 2026-04-30 22:08:08 -07:00
test_a2a_executor.py fix(a2a): route terminal Message via TaskUpdater.complete/failed in task mode 2026-05-03 04:06:45 -07:00
test_a2a_mcp_server.py docs(a2a-mcp): close three contract gaps codex agents inherit out-of-the-box 2026-05-05 02:26:35 -07:00
test_a2a_multi_workspace.py fix(tests): retarget remaining a2a_tools delegation patches to a2a_tools_delegation 2026-05-05 09:50:30 -07:00
test_a2a_tools_delegation.py refactor(workspace): extract delegation handlers from a2a_tools.py to a2a_tools_delegation.py (RFC #2873 iter 4b) 2026-05-05 05:00:52 -07:00
test_a2a_tools_impl.py refactor(workspace): extract delegation handlers from a2a_tools.py to a2a_tools_delegation.py (RFC #2873 iter 4b) 2026-05-05 05:00:52 -07:00
test_a2a_tools_module.py
test_a2a_tools_rbac.py refactor(workspace): extract RBAC helpers from a2a_tools.py to a2a_tools_rbac.py (RFC #2873 iter 4a) 2026-05-05 04:43:16 -07:00
test_adapter_base_event_log.py feat(workspace): wire EventLog into adapter base (#119 PR-3b) 2026-05-03 01:18:19 -07:00
test_adapter_base_signature.py test: extract shared signature-snapshot helpers + skill_loader gate 2026-04-30 06:27:20 -07:00
test_agent_card_well_known_path.py
test_agent.py
test_agents_md.py
test_approval.py
test_audit_ledger.py
test_audit.py
test_awareness_client_full.py
test_boot_routes.py test(runtime): pin PR #2756's card-vs-setup decoupling with build_routes helper 2026-05-04 14:59:56 -07:00
test_card_helpers.py fix(runtime): isolate card-skill enrichment + transcript handler from adapter shape mismatch 2026-05-04 14:15:27 -07:00
test_compliance.py
test_config.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_configs_dir.py fix(runtime): auto-fallback CONFIGS_DIR for non-container hosts (closes #2458) 2026-05-01 13:07:55 -07:00
test_consolidation.py
test_coordinator_parent.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_coordinator_routing.py
test_delegation_sync_via_polling.py fix(tests): retarget remaining a2a_tools delegation patches to a2a_tools_delegation 2026-05-05 09:50:30 -07:00
test_delegation.py
test_dispatcher_schema_drift.py test(mcp): structural gate — schema↔dispatcher drift catches dropped kwargs 2026-05-04 16:29:54 -07:00
test_event_log.py feat(workspace): event_log module + EventLogConfig (#119 PR-2) 2026-05-03 00:17:12 -07:00
test_events.py
test_executor_helpers.py fix(a2a): send v1 file Part shape; tolerate v1 server-side 2026-05-02 00:58:05 -07:00
test_gh_wrapper.sh
test_governance.py
test_heartbeat_runtime_metadata.py
test_heartbeat.py feat(workspace): wire observability config into heartbeat + uvicorn (#119 PR-3a) 2026-05-03 01:01:57 -07:00
test_hitl.py
test_inbox_uploads.py feat(poll-upload): phase 5b — concurrent BatchFetcher + httpx client reuse 2026-05-05 11:26:55 -07:00
test_inbox.py test(inbox): clean up daemon poller thread to prevent test cross-talk 2026-05-05 11:47:14 -07:00
test_internal_chat_uploads.py fix(workspace): surface errno + path on chat-upload mkdir failure 2026-05-01 11:47:53 -07:00
test_internal_file_read.py
test_jsonrpc_wire_role_format.py
test_load_skills_call_sites.py chore(workspace): remove dead defensive block in load_skills AST gate 2026-05-03 01:30:05 -07:00
test_main_initial_prompt.py
test_mcp_cli_multi_workspace.py fix: bot-lint nits — drop unused imports, add reason to except 2026-05-04 08:16:12 -07:00
test_mcp_cli_split.py refactor(workspace): split mcp_cli.py (626 LOC) into focused modules (RFC #2873 iter 3) 2026-05-05 04:33:06 -07:00
test_mcp_cli.py refactor(workspace): split mcp_cli.py (626 LOC) into focused modules (RFC #2873 iter 3) 2026-05-05 04:33:06 -07:00
test_mcp_memory.py
test_memory.py
test_molecule_ai_status.py
test_namespaces.py
test_not_configured_handler.py fix(runtime): decouple agent-card readiness from adapter.setup() 2026-05-04 10:22:31 -07:00
test_openclaw_adapter.py
test_platform_auth_signature.py test(platform_auth): module-functions signature snapshot drift gate 2026-04-30 08:41:42 -07:00
test_platform_auth.py fix(runtime): auto-fallback CONFIGS_DIR for non-container hosts (closes #2458) 2026-05-01 13:07:55 -07:00
test_platform_inbound_auth.py fix(runtime): auto-fallback CONFIGS_DIR for non-container hosts (closes #2458) 2026-05-01 13:07:55 -07:00
test_platform_tools.py
test_plugins_builtins.py
test_plugins_registry.py
test_plugins.py
test_pre_stop.py
test_preflight.py fix(preflight): downgrade required_env + auth_token failures to warnings 2026-05-04 12:20:34 -07:00
test_prompt.py feat: drop shared_context — use memory v2 team namespace instead 2026-05-04 16:30:26 -07:00
test_routing_policy.py
test_runtime_capabilities.py
test_runtime_wedge_signature.py test(runtime_wedge): module-functions signature snapshot drift gate 2026-04-30 07:01:10 -07:00
test_runtime_wedge.py chore(tests): drop redundant local _reset fixture from test_runtime_wedge 2026-05-01 18:31:21 -07:00
test_safe_env.py
test_sandbox.py
test_secret_redact.py
test_secret_redactor.py fix(runtime): redact secret-shaped tokens from JSON-RPC error.data 2026-05-04 15:07:53 -07:00
test_security_scan.py
test_shared_runtime_peer_summary.py
test_skill_loader_signature.py test: extract shared signature-snapshot helpers + skill_loader gate 2026-04-30 06:27:20 -07:00
test_skills_loader.py
test_skills_watcher.py
test_smoke_mode.py chore(smoke): runtime_wedge follow-ups from PR #2473 review 2026-05-01 18:01:51 -07:00
test_snapshot_scrub.py
test_telemetry.py
test_temporal_workflow.py
test_transcript_auth.py
test_watcher.py