Skip to content

Commit ca728f3

Browse files
ci(timeout): Use curl for better timeout control
1 parent 6536421 commit ca728f3

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed

.github/workflows/end-to-end-auto-prepend-test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ jobs:
220220
file_path: 11-appsec.js
221221

222222
- name: Prepare CrowdSec for AppSec timeout tests
223-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 450ms
223+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
224224

225225
- name: Run AppSec timeout tests
226226
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test

.github/workflows/end-to-end-multisite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
subsite: ${{ matrix.subsite }}
213213

214214
- name: Prepare CrowdSec for AppSec timeout tests
215-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 450ms
215+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
216216

217217
- name: Run AppSec timeout tests
218218
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test

.github/workflows/end-to-end-test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
file_path: 11-appsec.js
206206

207207
- name: Prepare CrowdSec for AppSec timeout tests
208-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 450ms
208+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
209209

210210
- name: Run AppSec timeout tests
211211
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test

.github/workflows/release-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ jobs:
236236
file_path: 11-appsec.js
237237

238238
- name: Prepare CrowdSec for AppSec timeout tests
239-
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 450ms
239+
run: ddev exec -s crowdsec tc qdisc add dev eth0 root netem delay 600ms
240240

241241
- name: Run AppSec timeout tests
242242
uses: ./wp-content/plugins/crowdsec/.github/workflows/end-to-end/run-single-test

tests/e2e-ddev/__scripts__/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ case $TYPE in
7777
COMMAND="yarn --cwd ${YARN_PATH} cross-env"
7878
LAPI_URL_FROM_PLAYWRIGHT=https://localhost:8080
7979
CURRENT_IP=$(ddev find-ip host)
80-
TIMEOUT=30000
80+
TIMEOUT=60000
8181
HEADLESS=false
8282
SLOWMO=0
8383
VARHTML_PATH="../../../../../"

tests/e2e-ddev/__tests__/12-appsec-timeout.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const {
1313
onAdminGoToAdvancedPage,
1414
selectByName,
1515
onAdminSaveSettings,
16-
wait,
16+
setToggle,
1717
} = require("../utils/helpers");
1818
const { CURRENT_IP } = require("../utils/constants");
1919

@@ -24,11 +24,13 @@ describe(`Should be captcha by AppSec because of timeout`, () => {
2424
await goToAdmin();
2525
await onLoginPageLoginAsAdmin();
2626
await setDefaultConfig();
27+
await onAdminGoToSettingsPage();
28+
await setToggle("crowdsec_use_curl", true);
29+
await onAdminSaveSettings();
2730
await enableAppSec();
2831
});
2932

3033
it("Should captcha for home page as this is the appsec fallback remediation", async () => {
31-
await wait(1000);
3234
await publicHomepageShouldBeCaptchaWall();
3335
});
3436

0 commit comments

Comments
 (0)