Skip to content

Commit

Permalink
Fix JavaScript connection batch requests test (#2986)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone authored Oct 28, 2024
1 parent 5865a62 commit 22fe85c
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions js/test/Ice/ami/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,28 @@ export class Client extends TestHelper {
out.write("testing batch requests with connection... ");
{
test((await p.opBatchCount()) === 0);
const b1 = p.ice_batchOneway();
let connection = await p.ice_getConnection();
const b1 = new Test.TestIntfPrx(connection.createProxy(p.ice_getIdentity()).ice_batchOneway());
await b1.opBatch();
const bf = b1.opBatch();
test(bf.isCompleted());
await b1.ice_flushBatchRequests();
await b1.opBatch();
await connection.flushBatchRequests();
test(await p.waitForBatch(2));
}

if ((await p.ice_getConnection()) !== null) {
test((await p.opBatchCount()) == 0);
const b1 = p.ice_batchOneway();
let connection = await p.ice_getConnection();
const b1 = new Test.TestIntfPrx(connection.createProxy(p.ice_getIdentity()).ice_batchOneway());
await b1.opBatch();
await b1.ice_getConnection().then((conn) => conn.close());
await b1.ice_flushBatchRequests();
test(await p.waitForBatch(1));
await connection.close();
try {
connection = await b1.ice_getConnection();
await connection.flushBatchRequests();
test(false);
} catch (ex) {
test(ex instanceof Ice.ConnectionClosedException);
}
test(await p.waitForBatch(0));
}
out.writeLine("ok");

Expand Down

0 comments on commit 22fe85c

Please sign in to comment.