You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An error will occur if the string decoder is used with commands that return only bytes as a response. We wont get an error the command will run forever.
I also observed the same issue in transaction test while working on DUMP and RESTORE commands.
If the user forgets to specify Decoder.Bytes as an argument in client.exec while trying to use DUMP, the test will either hang in VS Code terminal or fail from MAC terminal. We should throw the error and prevent the hanging.
Here is the snapshot of the codes, without Decoder.Bytes: (can also reference to PR #2126)
let response =
client instanceof GlideClient
? await client.exec(new Transaction().dump(key1))
: await client.exec(new ClusterTransaction().dump(key1));
expect(response?.[0]).not.toBeNull();
data = response?.[0] as GlideString;
Here is the output from MAC terminal:
GlideClient › dump and restore test_1
invalid utf-8 sequence of 1 bytes from index 10
656 | ) as T;
657 | } else {
> 658 | resolveAns = valueFromSplitPointer(
| ^
659 | resolveAns.high!,
660 | resolveAns.low!,
661 | stringDecoder,
at promiseCallbackFunctions.<computed> (src/BaseClient.ts:658:63)
at GlideClient.processResponse (src/BaseClient.ts:549:13)
at GlideClient.handleReadData (src/BaseClient.ts:514:22)
at Socket.<anonymous> (src/BaseClient.ts:598:40)
GlideClient › dump and restore test_1
thrown: "Exceeded timeout of 50000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."
5285 | );
5286 |
> 5287 | it.each([ProtocolVersion.RESP2, ProtocolVersion.RESP3])(
| ^
5288 | "dump and restore test_%p",
5289 | async (protocol) => {
5290 | await runTest(async (client: BaseClient) => {
at node_modules/jest-each/build/bind.js:45:11
at Array.forEach (<anonymous>)
at runBaseTests (tests/SharedTests.ts:5287:60)
at tests/GlideClient.test.ts:1248:17
at Object.<anonymous> (tests/GlideClient.test.ts:50:9)
Describe the bug
An error will occur if the string decoder is used with commands that return only bytes as a response. We wont get an error the command will run forever.
Expected Behavior
get an error
Current Behavior
the command will not return a response
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
Client version used
Engine type and version
OS
ubuntu
Language
TypeScript
Language Version
Cluster information
No response
Logs
No response
Other information
No response
The text was updated successfully, but these errors were encountered: