@rotorsoft/act-tck 1.30.0 → 1.30.1
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/store-tck.d.ts.map +1 -1
- package/dist/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1691,6 +1691,46 @@ var runStoreTck = (options) => {
|
|
|
1691
1691
|
await store.subscribe([{ stream: s }]);
|
|
1692
1692
|
expect8(await read()).toBe(10);
|
|
1693
1693
|
});
|
|
1694
|
+
it7("keeps the maximum for negative and zero priorities too", async () => {
|
|
1695
|
+
const s = `sub-pri-neg-${uid()}`;
|
|
1696
|
+
const read = async () => {
|
|
1697
|
+
const got = {};
|
|
1698
|
+
await store.query_streams(
|
|
1699
|
+
(p) => {
|
|
1700
|
+
got.priority = p.priority;
|
|
1701
|
+
},
|
|
1702
|
+
{ stream: s, stream_exact: true }
|
|
1703
|
+
);
|
|
1704
|
+
return got.priority;
|
|
1705
|
+
};
|
|
1706
|
+
await store.subscribe([{ stream: s, priority: -5 }]);
|
|
1707
|
+
expect8(await read()).toBe(-5);
|
|
1708
|
+
await store.subscribe([{ stream: s, priority: -1 }]);
|
|
1709
|
+
expect8(await read()).toBe(-1);
|
|
1710
|
+
await store.subscribe([{ stream: s, priority: -9 }]);
|
|
1711
|
+
expect8(await read()).toBe(-1);
|
|
1712
|
+
await store.subscribe([{ stream: s }]);
|
|
1713
|
+
expect8(await read()).toBe(0);
|
|
1714
|
+
});
|
|
1715
|
+
it7("restores the declared priority on the next subscribe after a prioritize() downgrade", async () => {
|
|
1716
|
+
const s = `sub-pri-restore-${uid()}`;
|
|
1717
|
+
const read = async () => {
|
|
1718
|
+
const got = {};
|
|
1719
|
+
await store.query_streams(
|
|
1720
|
+
(p) => {
|
|
1721
|
+
got.priority = p.priority;
|
|
1722
|
+
},
|
|
1723
|
+
{ stream: s, stream_exact: true }
|
|
1724
|
+
);
|
|
1725
|
+
return got.priority;
|
|
1726
|
+
};
|
|
1727
|
+
await store.subscribe([{ stream: s }]);
|
|
1728
|
+
expect8(await read()).toBe(0);
|
|
1729
|
+
await store.prioritize({ stream: s, stream_exact: true }, -5);
|
|
1730
|
+
expect8(await read()).toBe(-5);
|
|
1731
|
+
await store.subscribe([{ stream: s }]);
|
|
1732
|
+
expect8(await read()).toBe(0);
|
|
1733
|
+
});
|
|
1694
1734
|
it7("claims a subscribed stream and ack releases the lease", async () => {
|
|
1695
1735
|
const s = `claim-${uid()}`;
|
|
1696
1736
|
await store.subscribe([{ stream: s }]);
|