Skip to content

Commit

Permalink
chore(ci/e2e): fix polling ping timeout test (#436)
Browse files Browse the repository at this point in the history
In case of http polling heartbeat timeout, engine.io might send a close packet to an existing polling connection before closing.
Fix the test for this case.
  • Loading branch information
Totodore authored Jan 15, 2025
1 parent d89e78c commit a3f48f7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 188 deletions.
5 changes: 4 additions & 1 deletion e2e/engineioxide/test-suites/v4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,10 @@ describe("Engine.IO protocol", () => {
`${POLLING_URL}/engine.io/?EIO=4&transport=polling&sid=${sid}`,
);

assert.deepStrictEqual(pollResponse.status, 400);
assert(
pollResponse.status == 400 ||
(pollResponse.status == 200 && (await pollResponse.text()) == "1"),
);
});
});

Expand Down
185 changes: 0 additions & 185 deletions e2e/socketioxide/test-suites/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion e2e/socketioxide/test-suites/v5-msgpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ describe("Engine.IO protocol", () => {
`${POLLING_URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`,
);

assert.equal(pollResponse.status, 400);
assert(
pollResponse.status == 400 ||
(pollResponse.status == 200 && (await pollResponse.text()) == "1"),
);
});
});

Expand Down
5 changes: 4 additions & 1 deletion e2e/socketioxide/test-suites/v5.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ describe("Engine.IO protocol", () => {
`${POLLING_URL}/socket.io/?EIO=4&transport=polling&sid=${sid}`,
);

assert.equal(pollResponse.status, 400);
assert(
pollResponse.status == 400 ||
(pollResponse.status == 200 && (await pollResponse.text()) == "1"),
);
});
});

Expand Down

0 comments on commit a3f48f7

Please sign in to comment.