Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/redis-wiring-test-stabilize.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Test-only: stabilize the Redis driver wiring contract test (hoist imports out of the timed test body to fix a flaky 5s timeout on slow CI).
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ import {
runKVContract,
runCounterContract,
} from '@objectstack/service-cluster/testing';
// Load the driver entrypoint at module eval — importing it registers the
// 'redis' cluster driver as a side-effect, which `defineCluster({ driver:
// 'redis' })` then resolves. Doing this here (not via `await import()` inside
// the timed test bodies) keeps the one-time cold module-load cost out of the
// per-test 5s timeout — the wiring tests below were flaky on slow CI for
// exactly that reason (the first test paid the full import cost and timed out).
import './index.js';
import { defineCluster } from '@objectstack/service-cluster';

import { RedisPubSub } from './pubsub.js';
import { RedisLock } from './lock.js';
Expand Down Expand Up @@ -118,8 +126,6 @@ describe('IPubSub contract — redis(mock)', () => {

describe('Redis driver — wiring', () => {
it('exports a registerable driver and defineCluster picks it up', async () => {
await import('./index.js');
const { defineCluster } = await import('@objectstack/service-cluster');
const client = makeClient();
const cluster = defineCluster({
driver: 'redis',
Expand All @@ -145,8 +151,6 @@ describe('Redis driver — wiring', () => {
});

it('does NOT quit caller-owned client on close', async () => {
await import('./index.js');
const { defineCluster } = await import('@objectstack/service-cluster');
const client = makeClient();
const cluster = defineCluster({
driver: 'redis',
Expand Down
Loading