HarperFast / HarperFast/harper

main Unit Test red since 9160c09f6 (#1345 runIndexing test): subscriptionReplay suite destabilized (different edge-case test fails per run)

Open
#1,617 0 comments 0 reactions 1 assignee Claimed by @kriszyp View on GitHub
Dominant language
JavaScript
Stars
89
Forks
10
Avg merge
2d 6h
Merged PRs (30d)
200

Description

## Symptom

`main`'s Unit Test workflow has been red for four consecutive runs (since ~12:21 UTC 2026-07-06), each failing in **`unitTests/resources/subscriptionReplay.test.js` → "Subscription replay > edge cases"** — but a *different* test within that suite per run:

- run on `ab88fbe70` (14:16): `count: previousCount larger than total records returns all available` — `AssertionError: missing id 0`
- runs on PR branches cut from current main (e.g. #1616, 3/3 Node versions): `audit records of types not in ACTIONS_OF_INTEREST are still delivered by cursor` — `expected at least 1 event for id=1, got 0`

Different assertions, same suite, deterministic-per-run → suite instability, not a single broken test.

## Bisection by CI history

| main commit | Unit CI |
|---|---|
| `ecfb99583` — #1558 assert migration | ✅ success (12:21) |
| `9160c09f6` — **test(resources): cover search_by_value during active runIndexing (#1345)** | ❌ failure (12:21) |
| `ab88fbe70` | ❌ failure |
| `80af51239` | ❌ failure |
| `50ea3f47c` | ❌ failure |

The boundary is exactly `9160c09f6`. The new test exercises `search_by_value` **during active `runIndexing`** — i.e., it deliberately holds/creates in-flight indexing state. The failure shape downstream (subscription-replay cursor events missing) is consistent with the new test polluting shared database/indexing state or scheduling for the `subscriptionReplay` suite in the same mocha process.

## Impact

Every PR cut from current main fails Unit Test (all Node versions), masking real signal — e.g. #1616 burned a triage cycle attributing this to its own diff.

## Suggested first look

- Does `9160c09f6`'s test clean up its indexing state (`indexingOperation` completion awaited? table/db dropped?) before the suite ends?
- Run `unitTests/resources/` suite locally with and without the new test file present — confirm the subscriptionReplay instability follows it.

---
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.