@rotorsoft/act-tck 1.36.16 → 1.36.18
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 +44 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3166,6 +3166,50 @@ var runStoreTck = (options) => {
|
|
|
3166
3166
|
});
|
|
3167
3167
|
expect8(seen).toEqual(["fast"]);
|
|
3168
3168
|
});
|
|
3169
|
+
it7("keeps the lane when a lower-priority subscribe re-registers", async () => {
|
|
3170
|
+
const s = `lane-rank-${uid()}`;
|
|
3171
|
+
await store.subscribe([{ stream: s, lane: "fast", priority: 10 }]);
|
|
3172
|
+
await store.subscribe([{ stream: s, lane: "slow", priority: 0 }]);
|
|
3173
|
+
const seen = [];
|
|
3174
|
+
await store.query_streams(
|
|
3175
|
+
(p) => seen.push({ lane: p.lane, priority: p.priority }),
|
|
3176
|
+
{ stream: s, stream_exact: true }
|
|
3177
|
+
);
|
|
3178
|
+
expect8(seen).toEqual([{ lane: "fast", priority: 10 }]);
|
|
3179
|
+
});
|
|
3180
|
+
it7("keeps the lane when a mark-only subscribe re-registers", async () => {
|
|
3181
|
+
const s = `lane-mark-${uid()}`;
|
|
3182
|
+
await store.subscribe([{ stream: s, lane: "fast", priority: 10 }]);
|
|
3183
|
+
await store.subscribe([{ stream: s, correlated_at: 7 }]);
|
|
3184
|
+
const seen = [];
|
|
3185
|
+
await store.query_streams(
|
|
3186
|
+
(p) => seen.push({ lane: p.lane, correlated_at: p.correlated_at }),
|
|
3187
|
+
{ stream: s, stream_exact: true }
|
|
3188
|
+
);
|
|
3189
|
+
expect8(seen).toEqual([{ lane: "fast", correlated_at: 7 }]);
|
|
3190
|
+
});
|
|
3191
|
+
it7("re-lanes when the subscribe outranks the stored priority", async () => {
|
|
3192
|
+
const s = `lane-outrank-${uid()}`;
|
|
3193
|
+
await store.subscribe([{ stream: s, lane: "fast", priority: 0 }]);
|
|
3194
|
+
await store.subscribe([{ stream: s, lane: "slow", priority: 5 }]);
|
|
3195
|
+
const seen = [];
|
|
3196
|
+
await store.query_streams(
|
|
3197
|
+
(p) => seen.push({ lane: p.lane, priority: p.priority }),
|
|
3198
|
+
{ stream: s, stream_exact: true }
|
|
3199
|
+
);
|
|
3200
|
+
expect8(seen).toEqual([{ lane: "slow", priority: 5 }]);
|
|
3201
|
+
});
|
|
3202
|
+
it7("re-lanes at equal priority, which is what keeps re-laning restart-driven", async () => {
|
|
3203
|
+
const s = `lane-equal-${uid()}`;
|
|
3204
|
+
await store.subscribe([{ stream: s, lane: "fast", priority: 7 }]);
|
|
3205
|
+
await store.subscribe([{ stream: s, lane: "slow", priority: 7 }]);
|
|
3206
|
+
const seen = [];
|
|
3207
|
+
await store.query_streams((p) => seen.push(p.lane), {
|
|
3208
|
+
stream: s,
|
|
3209
|
+
stream_exact: true
|
|
3210
|
+
});
|
|
3211
|
+
expect8(seen).toEqual(["slow"]);
|
|
3212
|
+
});
|
|
3169
3213
|
it7("claim() filters by lane when supplied and returns lane on the Lease", async () => {
|
|
3170
3214
|
const tag = uid();
|
|
3171
3215
|
const src1 = `lane-claim-src1-${tag}`;
|