Skip to content

Commit 7d420eb

Browse files
committed
Fix queue E2E test failures: TTL validation and delete by ID
Queue TTL is in minutes (max 60), not seconds — tests were passing 3600 and 1800 which caused 422 errors. Queue delete requires the full queue ID (appId:region:name), not just the queue name.
1 parent 1ffb6d0 commit 7d420eb

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

test/e2e/control-api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ describe.skipIf(!process.env.E2E_ABLY_ACCESS_TOKEN)(
226226
const queueData = {
227227
name: testQueueName,
228228
maxLength: 1000,
229-
ttl: 3600,
229+
ttl: 60,
230230
region: "us-east-1-a",
231231
};
232232

@@ -236,7 +236,7 @@ describe.skipIf(!process.env.E2E_ABLY_ACCESS_TOKEN)(
236236
expect(queue).toHaveProperty("name", testQueueName);
237237
expect(queue).toHaveProperty("appId", testAppId);
238238
expect(queue).toHaveProperty("maxLength", 1000);
239-
expect(queue).toHaveProperty("ttl", 3600);
239+
expect(queue).toHaveProperty("ttl", 60);
240240
expect(queue).toHaveProperty("region", "us-east-1-a");
241241

242242
createdResources.queues.push(testQueueName);

test/e2e/control/control-api-workflows.test.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ describe("Control API E2E Workflow Tests", () => {
370370
"--max-length",
371371
"5000",
372372
"--ttl",
373-
"1800",
373+
"60",
374374
"--region",
375375
"eu-west-1-a",
376376
"--json",
@@ -394,7 +394,7 @@ describe("Control API E2E Workflow Tests", () => {
394394
);
395395
expect(result.queue as Record<string, unknown>).toHaveProperty(
396396
"ttl",
397-
1800,
397+
60,
398398
);
399399
});
400400

@@ -423,16 +423,22 @@ describe("Control API E2E Workflow Tests", () => {
423423
if (shouldSkip) return;
424424

425425
const queueName = `test-delete-queue-${Date.now()}`;
426-
// First create a queue
427-
await runCommand(
426+
// First create a queue and capture its ID
427+
const createResult = await runCommand(
428428
["queues", "create", "--app", testAppId, "--name", queueName, "--json"],
429429
{
430430
env: { ABLY_ACCESS_TOKEN: process.env.E2E_ABLY_ACCESS_TOKEN },
431431
},
432432
);
433433

434+
const createOutput = parseNdjsonLines(createResult.stdout).find(
435+
(r) => r.type === "result",
436+
) as Record<string, unknown>;
437+
const queueId = (createOutput.queue as Record<string, unknown>)
438+
.id as string;
439+
434440
const deleteResult = await runCommand(
435-
["queues", "delete", queueName, "--app", testAppId, "--force"],
441+
["queues", "delete", queueId, "--app", testAppId, "--force"],
436442
{
437443
env: { ABLY_ACCESS_TOKEN: process.env.E2E_ABLY_ACCESS_TOKEN },
438444
},

0 commit comments

Comments
 (0)