Skip to content

Commit

Permalink
Add test for large query and response
Browse files Browse the repository at this point in the history
  • Loading branch information
lideming committed Oct 9, 2020
1 parent 9ff345b commit 5defdf6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,21 @@ testWithClient(async function testReadTimeout(client) {
timeout: 500,
});

testWithClient(async function testLargeQueryAndResponse(client) {
function buildLargeString(len: number) {
let str = "";
for (let i = 0; i < len; i++) {
str += (i % 10);
}
return str;
}
const largeString = buildLargeString(512 * 1024);
assertEquals(
await client.query(`select "${largeString}" as str`),
[{ str: largeString }],
);
});

await createTestDB();

await new Promise((r) => setTimeout(r, 0));
Expand Down

0 comments on commit 5defdf6

Please sign in to comment.