@rotorsoft/act-tck 1.27.2 → 1.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAEN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IAurHtD,CAAC"}
1
+ {"version":3,"file":"store-tck.d.ts","sourceRoot":"","sources":["../../src/store-tck.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAQV,KAAK,EAEN,MAAM,sBAAsB,CAAC;AAc9B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;;;;OAQG;IACH,QAAQ,CAAC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CACrD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAC3C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,eAAO,MAAM,WAAW,YAAa,eAAe,KAAG,IAqvHtD,CAAC"}
package/dist/index.cjs CHANGED
@@ -1712,6 +1712,55 @@ var runStoreTck = (options) => {
1712
1712
  const second = await store.claim(0, 100, `w-${uid()}`, 1);
1713
1713
  (0, import_vitest9.expect)(second.find((l) => l.stream === s)).toBeDefined();
1714
1714
  });
1715
+ (0, import_vitest9.it)("does not starve a default-priority lagging stream under sustained high-priority load (ACT-1223)", async () => {
1716
+ const fresh = await options.factory();
1717
+ try {
1718
+ await fresh.drop();
1719
+ await fresh.seed();
1720
+ const suffix = uid();
1721
+ const highs = Array.from(
1722
+ { length: 6 },
1723
+ (_, i) => `hi-${i}-${suffix}`
1724
+ );
1725
+ const low = `lo-${suffix}`;
1726
+ await fresh.subscribe([
1727
+ ...highs.map((stream) => ({ stream, priority: 100 })),
1728
+ { stream: low, priority: 0 }
1729
+ ]);
1730
+ for (const stream of highs)
1731
+ await fresh.commit(
1732
+ stream,
1733
+ [inc(1)],
1734
+ make_meta({ stream })
1735
+ );
1736
+ await fresh.commit(
1737
+ low,
1738
+ [inc(1)],
1739
+ make_meta({ stream: low })
1740
+ );
1741
+ const by = `w-${uid()}`;
1742
+ let low_claimed = false;
1743
+ const MAX_CYCLES = 20;
1744
+ for (let cycle = 0; cycle < MAX_CYCLES && !low_claimed; cycle++) {
1745
+ const leases = await fresh.claim(4, 0, by, 1e3);
1746
+ if (leases.some((l) => l.stream === low)) {
1747
+ low_claimed = true;
1748
+ break;
1749
+ }
1750
+ for (const l of leases) {
1751
+ await fresh.ack([{ ...l, at: l.at + 1 }]);
1752
+ await fresh.commit(
1753
+ l.stream,
1754
+ [inc(1)],
1755
+ make_meta({ stream: l.stream })
1756
+ );
1757
+ }
1758
+ }
1759
+ (0, import_vitest9.expect)(low_claimed).toBe(true);
1760
+ } finally {
1761
+ await fresh.dispose();
1762
+ }
1763
+ });
1715
1764
  (0, import_vitest9.it)("dedupes when both frontiers would return the same stream", async () => {
1716
1765
  const s = `claim-dedup-${uid()}`;
1717
1766
  await store.subscribe([{ stream: s }]);