Fix flakey cypress test

This commit is contained in:
Jamie Curnow committed 2026-10-09 22:35:02 +10:00
1 parent 1454252acd
commit 717877db3f
2 files changed
+9

No files matched your search

@@ -192,7 +192,11 @@ describe('Access Lists across Proxy Host disable/enable', () => {
expect(data).to.be.equal(true);
});
// Each delete signals an nginx reload and returns immediately. A request
// made while the workers are being swapped can be reset by the nginx
// serving the API (502 from squid), so let each reload settle first.
[authListId, clientListId].forEach((id) => {
cy.wait(1500);
cy.task('backendApiDelete', {
token: token,
path: `/api/nginx/access-lists/${id}`,
@@ -1,3 +1,4 @@
import http from "node:http";
import axios from "axios";
import logger from "./logger.mjs";
@@ -8,6 +9,10 @@ const BackendApi = function (config, token) {
this.axios = axios.create({
baseURL: config.baseUrl,
timeout: 90000,
// Don't reuse sockets: a pooled keep-alive connection that squid or the
// backend has since closed fails with a 502 (ERR_READ_ERROR 104), which
// made tests flaky.
httpAgent: new http.Agent({ keepAlive: false }),
});
};