Bug Summary
The resources unit test Audit log › can handle separate subscriptions on separate dbs (unitTests/resources/auditLog.test.js:502) fails on main:
AssertionError [ERR_ASSERTION]: 2 == 1
at Context.<anonymous> (unitTests/resources/auditLog.test.js:502:11)
The test creates DB_COUNT = 3 tables on separate databases (test-subscribe0/1/2), subscribes to each, puts a single record into each, waits for the first data event per table, then asserts each subscription received exactly one event. One subscription receives 2 events for its single put — so this is either a duplicate data delivery or cross-database subscription event leakage.
Reproduction
- Node v22.21.1, RocksDB (default storage engine), macOS.
- Fails on a clean checkout of
main (commit 266d5d8b), both:
1. Check out main.
2. npm run build
3. npx mocha unitTests/resources/auditLog.test.js
4. Observe `can handle separate subscriptions on separate dbs` failing with `2 == 1`.
Notes / scope
First triage question
Is one subscription receiving a duplicate data event for its own single put, or an event leaked from another database's table/log? The audit/transaction-log subscription machinery (RocksTransactionLogStore per-log iterators, listenToCommits) is the place to look — a subscription keyed to one db's log picking up another db's commit, or re-emitting a single commit twice, would both produce 2 == 1 here.
🤖 Generated with Claude Code
Bug Summary
The resources unit test
Audit log › can handle separate subscriptions on separate dbs(unitTests/resources/auditLog.test.js:502) fails onmain:The test creates
DB_COUNT = 3tables on separate databases (test-subscribe0/1/2), subscribes to each,puts a single record into each, waits for the firstdataevent per table, then asserts each subscription received exactly one event. One subscription receives 2 events for its single put — so this is either a duplicatedatadelivery or cross-database subscription event leakage.Reproduction
main(commit266d5d8b), both:npx mocha unitTests/resources/auditLog.test.js— failed 5/5 runs (17 passing, 1 failing each).npm run test:unit:resources—685 passing … 2 failingon clean main (the other failure being Unit test red on main: 're-delivered duplicate must not double-apply the commutative op' (v22 + v26) #1137).Notes / scope
mainactually has two red tests in the resources suite, not one. The Unit test red on main: 're-delivered duplicate must not double-apply the commutative op' (v22 + v26) #1137 CI run (https://github.com/HarperFast/harper/actions/runs/26961236701) reported only the Unit test red on main: 're-delivered duplicate must not double-apply the commutative op' (v22 + v26) #1137 failure with this test green — so this one appears environment/load-sensitive (deterministic on this machine, evidently passing on CI).f4742911(Test the separate db subscriptions) and most recently changed inad7194db(replace the fixeddelay(40)with an event-driven wait). The event-driven wait resolves on the firstdataevent but then asserts the total count is 1 afterPromise.all— so an extra/duplicate event on any one subscription trips it.First triage question
Is one subscription receiving a duplicate
dataevent for its own singleput, or an event leaked from another database's table/log? The audit/transaction-log subscription machinery (RocksTransactionLogStoreper-log iterators,listenToCommits) is the place to look — a subscription keyed to one db's log picking up another db's commit, or re-emitting a single commit twice, would both produce2 == 1here.🤖 Generated with Claude Code