Skip to content

Commit 2f258ab

Browse files
committed
test(reactive-rpc): 💍 remove message latency and reordering
1 parent b3ee10c commit 2f258ab

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

src/reactive-rpc/common/testing/buildE2eClient.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ export interface BuildE2eClientOptions {
2525
*/
2626
writerDefaultBufferKb?: [min: number, max: number];
2727

28-
/**
29-
* Minimum and maximum request latencies in milliseconds. An actual latency
30-
* number will be picked randomly between these two values. Defaults to
31-
* `[1, 1]`.
32-
*/
33-
requestLatency?: [min: number, max: number];
34-
35-
/**
36-
* Minimum and maximum response latencies in milliseconds. An actual latency
37-
* number will be picked randomly between these two values. Defaults to
38-
* `[1, 1]`.
39-
*/
40-
responseLatency?: [min: number, max: number];
41-
4228
/**
4329
* Number of messages to keep in buffer before sending them to the client.
4430
* The actual number of messages will be picked randomly between these two
@@ -95,23 +81,21 @@ export const buildE2eClient = <Caller extends TypeRouterCaller<any>>(caller: Cal
9581
caller,
9682
send: (messages: ReactiveRpcMessage[]) => {
9783
const encoded = ctx.msgCodec.encode(ctx.resCodec, messages);
98-
const latency = opt.responseLatency ?? [1, 1];
9984
setTimeout(() => {
10085
const decoded = ctx.msgCodec.decodeBatch(ctx.resCodec, encoded);
10186
client.onMessages(decoded as ReactiveRpcServerMessage[]);
102-
}, Fuzzer.randomInt(latency[0], latency[1]));
87+
}, 1);
10388
},
10489
bufferSize: Fuzzer.randomInt2(opt.serverBufferSize ?? [1, 1]),
10590
bufferTime: Fuzzer.randomInt2(opt.serverBufferTime ?? [0, 0]),
10691
});
10792
client = new StreamingRpcClient({
10893
send: (messages: ReactiveRpcClientMessage[]) => {
10994
const encoded = ctx.msgCodec.encode(ctx.reqCodec, messages);
110-
const latency = opt.requestLatency ?? [1, 1];
11195
setTimeout(() => {
11296
const decoded = ctx.msgCodec.decodeBatch(ctx.reqCodec, encoded);
11397
streamProcessor.onMessages(decoded as ReactiveRpcClientMessage[], {});
114-
}, Fuzzer.randomInt(latency[0], latency[1]));
98+
}, 1);
11599
},
116100
bufferSize: Fuzzer.randomInt2(opt.clientBufferSize ?? [1, 1]),
117101
bufferTime: Fuzzer.randomInt2(opt.clientBufferTime ?? [0, 0]),

src/server/__tests__/setup.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export const setup = () => {
1111
clientBufferTime: [1, 10],
1212
serverBufferSize: [1, 3],
1313
serverBufferTime: [1, 10],
14-
requestLatency: [1, 10],
15-
responseLatency: [1, 10],
1614
});
1715
const call = client.call.bind(client);
1816
const call$ = client.call$.bind(client);

0 commit comments

Comments
 (0)