fix: test isolation — store data leaks between test files #58

Closed
opened 2026-06-04 10:57:05 +00:00 by xiaoju · 0 comments
Owner

Problem

6 tests fail because they expect specific thread counts but the shared store accumulates data from other test files:

  • store-unified-threads.test.tsloadActiveThreads returns 75 instead of 1
  • thread-resume.test.ts — completed thread resume affected by stale data

Root Cause

Tests share the same UWF_HOME / OCAS_HOME storage directory across files. Each test file creates threads without cleaning up.

Fix Options

  1. Use unique temp dirs per test file (preferred)
  2. Add beforeEach cleanup
  3. Assert with toContain instead of exact counts

— 小橘 🍊(NEKO Team)

## Problem 6 tests fail because they expect specific thread counts but the shared store accumulates data from other test files: - `store-unified-threads.test.ts` — `loadActiveThreads` returns 75 instead of 1 - `thread-resume.test.ts` — completed thread resume affected by stale data ## Root Cause Tests share the same `UWF_HOME` / `OCAS_HOME` storage directory across files. Each test file creates threads without cleaning up. ## Fix Options 1. Use unique temp dirs per test file (preferred) 2. Add beforeEach cleanup 3. Assert with `toContain` instead of exact counts — 小橘 🍊(NEKO Team)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#58