You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
@@ -477,8 +477,11 @@ describe('Client', () => {
|
|||||||
assert.ok(id !== isolatedId);
|
assert.ok(id !== isolatedId);
|
||||||
}, GLOBAL.SERVERS.OPEN);
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
|
|
||||||
async function killClient<M extends RedisModules, S extends RedisScripts>(client: RedisClientType<M, S>): Promise<void> {
|
async function killClient<M extends RedisModules, S extends RedisScripts>(
|
||||||
const onceErrorPromise = once(client, 'error');
|
client: RedisClientType<M, S>,
|
||||||
|
errorClient: RedisClientType<M, S> = client
|
||||||
|
): Promise<void> {
|
||||||
|
const onceErrorPromise = once(errorClient, 'error');
|
||||||
await client.sendCommand(['QUIT']);
|
await client.sendCommand(['QUIT']);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
onceErrorPromise,
|
onceErrorPromise,
|
||||||
@@ -503,6 +506,10 @@ describe('Client', () => {
|
|||||||
minimumDockerVersion: [6, 2] // CLIENT INFO
|
minimumDockerVersion: [6, 2] // CLIENT INFO
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testUtils.testWithClient('should propagated errors from "isolated" clients', client => {
|
||||||
|
return client.executeIsolated(isolated => killClient(isolated, client));
|
||||||
|
}, GLOBAL.SERVERS.OPEN);
|
||||||
|
|
||||||
testUtils.testWithClient('scanIterator', async client => {
|
testUtils.testWithClient('scanIterator', async client => {
|
||||||
const promises = [],
|
const promises = [],
|
||||||
keys = new Set();
|
keys = new Set();
|
||||||
|
@@ -189,7 +189,7 @@ export default class RedisClient<M extends RedisModules, S extends RedisScripts>
|
|||||||
create: async () => {
|
create: async () => {
|
||||||
const duplicate = this.duplicate({
|
const duplicate = this.duplicate({
|
||||||
isolationPoolOptions: undefined
|
isolationPoolOptions: undefined
|
||||||
});
|
}).on('error', err => this.emit('error', err));
|
||||||
await duplicate.connect();
|
await duplicate.connect();
|
||||||
return duplicate;
|
return duplicate;
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user