fix: test error

This commit is contained in:
chenos 2024-07-23 13:37:04 +08:00 committed by mytharcher
parent 6ac9117e9d
commit acc22c14b2

View File

@ -8,6 +8,7 @@
*/ */
import { createMockServer, MockServer } from '@nocobase/test'; import { createMockServer, MockServer } from '@nocobase/test';
import { uid } from '@nocobase/utils';
import { createClient } from 'redis'; import { createClient } from 'redis';
import Plugin from '../plugin'; import Plugin from '../plugin';
import { IPubSubAdapter } from '../pub-sub-manager'; import { IPubSubAdapter } from '../pub-sub-manager';
@ -76,11 +77,11 @@ describe('pub-sub-manager', () => {
}; };
const node1: MockServer = await createMockServer({ const node1: MockServer = await createMockServer({
...appOpts, ...appOpts,
name: 'node1', name: 'app1_' + uid(),
}); });
const node2: MockServer = await createMockServer({ const node2: MockServer = await createMockServer({
...appOpts, ...appOpts,
name: 'node2', name: 'app1_' + uid(),
}); });
await node1.pubSubManager.publish('chan1nel', `channel1_message_1`); await node1.pubSubManager.publish('chan1nel', `channel1_message_1`);
await sleep(1000); await sleep(1000);