Skip to content

Commit 1ad94a9

Browse files
qunit tests: fix runner stalled freezes (#31274) (#31781)
1 parent d23d600 commit 1ad94a9

41 files changed

Lines changed: 384 additions & 162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/run-qunit-tests/action.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ inputs:
2525
useCsp:
2626
description: "Indicates if tests should run with Content Security Policy (CSP) enabled"
2727
default: "true"
28+
maxWorkers:
29+
description: "Maximum number of parallel test workers"
30+
default: ""
2831

2932
runs:
3033
using: composite
@@ -36,23 +39,15 @@ runs:
3639
echo "MATRIX_ENVS_NAME_SAFE=$MATRIX_ENVS_NAME_SAFE"
3740
echo "MATRIX_ENVS_NAME_SAFE=$MATRIX_ENVS_NAME_SAFE" >> $GITHUB_ENV
3841
39-
# - name: Update apt
40-
# run: |
41-
# sudo apt-get update
42-
43-
# - name: Setup utils
44-
# run: |
45-
# sudo apt-get install -y dbus-x11 httping x11vnc xvfb
42+
# - name: Setup Chrome
43+
# uses: ./.github/actions/setup-chrome-headless-shell
44+
# with:
45+
# chrome-version: '141.0.7390.122'
4646

47-
- name: Setup Chrome
48-
uses: ./.github/actions/setup-chrome-headless-shell
49-
with:
50-
chrome-version: '141.0.7390.122'
51-
52-
- name: Use Node.js
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: '20'
47+
# - name: Use Node.js
48+
# uses: actions/setup-node@v4
49+
# with:
50+
# node-version: '20'
5651

5752
- name: Download artifacts
5853
uses: actions/download-artifact@v4
@@ -109,14 +104,14 @@ runs:
109104
NORENOVATION: "false"
110105
GITHUBACTION: "true"
111106
TARGET: "test"
112-
DISPLAY: ":99"
113107
CHROME_CMD: ${{ env.CHROME_SHELL }}
108+
MAX_WORKERS: ${{ inputs.maxWorkers }}
114109
run: |
115110
chmod +x ./docker-ci.sh
116111
./docker-ci.sh
117112
118113
- name: Copy RawLog.txt
119-
if: ${{ failure() }}
114+
if: ${{ always() }}
120115
uses: actions/upload-artifact@v4
121116
with:
122117
name: RawLog-${{ env.MATRIX_ENVS_NAME_SAFE }}

.github/workflows/demos_visual_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,11 @@ jobs:
710710
id: set-concurrency
711711
run: |
712712
if [[ "${{ matrix.CONSTEL }}" == react* ]]; then
713-
echo "concurrency=3" >> $GITHUB_OUTPUT
713+
echo "concurrency=4" >> $GITHUB_OUTPUT
714714
elif [[ "${{ matrix.CONSTEL }}" == angular* ]]; then
715-
echo "concurrency=2" >> $GITHUB_OUTPUT
715+
echo "concurrency=3" >> $GITHUB_OUTPUT
716716
else
717-
echo "concurrency=2" >> $GITHUB_OUTPUT
717+
echo "concurrency=3" >> $GITHUB_OUTPUT
718718
fi
719719
720720
- name: Run TestCafe tests

.github/workflows/qunit_tests.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,40 +90,36 @@ jobs:
9090
needs: build
9191
runs-on: devextreme-shr2
9292
name: Constel ${{ matrix.CONSTEL }}${{ matrix.TIMEZONE != '' && format('-{0}', matrix.TIMEZONE) || '' }}${{ matrix.CSP == 'false' && '-no-csp' || '' }}
93-
timeout-minutes: 60
93+
timeout-minutes: 20
9494
strategy:
9595
fail-fast: false
9696
matrix:
9797
CONSTEL: [
98-
export,
9998
misc,
10099
ui,
101100
ui.editors,
102-
ui.htmlEditor,
103101
ui.grid,
104-
ui.scheduler(1/2),
105-
ui.scheduler(2/2),
106-
viz
102+
ui.scheduler,
107103
]
108104
TIMEZONE: ['']
109105
CSP: ['true']
110106
useJQuery: ['false']
107+
MAX_WORKERS: ['']
111108
include:
112-
- CONSTEL: ui.scheduler(1/2)
113-
TIMEZONE: US/Pacific
109+
- CONSTEL: export
110+
MAX_WORKERS: '3'
114111
useJQuery: 'false'
115-
- CONSTEL: ui.scheduler(2/2)
112+
CSP: 'true'
113+
- CONSTEL: ui.scheduler
116114
TIMEZONE: US/Pacific
117115
useJQuery: 'false'
118116
- CONSTEL: misc
119117
CSP: 'false'
120118
useJQuery: 'true'
121-
- CONSTEL: ui.widgets(1/2)
122-
CSP: 'false'
123-
useJQuery: 'false'
124-
- CONSTEL: ui.widgets(2/2)
119+
- CONSTEL: ui.widgets
125120
CSP: 'false'
126121
useJQuery: 'false'
122+
MAX_WORKERS: '3'
127123

128124
steps:
129125
- name: Get sources
@@ -137,6 +133,7 @@ jobs:
137133
timezone: ${{ matrix.TIMEZONE }}
138134
useJQuery: ${{ matrix.useJQuery }}
139135
useCsp: ${{ matrix.CSP }}
136+
maxWorkers: ${{ matrix.MAX_WORKERS || '' }}
140137

141138
qunit-tests-shadow-dom:
142139
needs: [check-should-run-all, build]
@@ -149,16 +146,10 @@ jobs:
149146
matrix:
150147
constel: [
151148
'ui',
152-
'ui.widgets(1/2)',
153-
'ui.widgets(2/2)',
154-
'ui.editors(1/2)',
155-
'ui.editors(2/2)',
156-
'ui.htmlEditor',
157-
'ui.grid(1/2)',
158-
'ui.grid(2/2)',
159-
'ui.scheduler(1/2)',
160-
'ui.scheduler(2/2)',
161-
'viz'
149+
'ui.widgets',
150+
'ui.editors',
151+
'ui.grid',
152+
'ui.scheduler',
162153
]
163154

164155
steps:
@@ -173,6 +164,7 @@ jobs:
173164
useJQuery: 'true'
174165
useShadowDom: 'true'
175166
useCsp: 'true'
167+
maxWorkers: ${{ (matrix.constel == 'ui.editors' || matrix.constel == 'ui.widgets') && '3' || '' }}
176168

177169
notify:
178170
runs-on: devextreme-shr2

.github/workflows/testcafe_tests.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
fail-fast: false
9696
matrix:
9797
ARGS: [
98-
{ componentFolder: "accessibility", name: "accessibility" },
98+
{ componentFolder: "accessibility", name: "accessibility", concurrency: 6 },
9999
{ componentFolder: "common", name: "common" },
100100

101101
{ name: "generic", theme: 'generic.light' },
@@ -108,10 +108,11 @@ jobs:
108108
# { componentFolder: "editors", name: "editors - themes" },
109109
# { componentFolder: "navigation", name: "navigation - themes" },
110110

111-
{ componentFolder: "cardView", name: "cardView" },
112-
{ componentFolder: "dataGrid", name: "dataGrid (1/3)", indices: "1/3" },
113-
{ componentFolder: "dataGrid", name: "dataGrid (2/3)", indices: "2/3" },
114-
{ componentFolder: "dataGrid", name: "dataGrid (3/3)", indices: "3/3" },
111+
{ componentFolder: "cardView", name: "cardView", cache: true },
112+
{ componentFolder: "dataGrid", name: "dataGrid (1/4)", indices: "1/4", cache: true },
113+
{ componentFolder: "dataGrid", name: "dataGrid (2/4)", indices: "2/4", cache: true },
114+
{ componentFolder: "dataGrid", name: "dataGrid (3/4)", indices: "3/4", cache: true },
115+
{ componentFolder: "dataGrid", name: "dataGrid (4/4)", indices: "4/4", cache: true },
115116

116117
{ componentFolder: "editors", name: "editors" },
117118
{ componentFolder: "navigation", name: "navigation" },
@@ -146,10 +147,10 @@ jobs:
146147
working-directory: ./packages/devextreme
147148
run: 7z x artifacts.zip -aoa
148149

149-
- name: Setup Chrome
150-
uses: ./.github/actions/setup-chrome
151-
with:
152-
chrome-version: '141.0.7390.122'
150+
# - name: Setup Chrome
151+
# uses: ./.github/actions/setup-chrome
152+
# with:
153+
# chrome-version: '141.0.7390.122'
153154

154155
- name: Use Node.js
155156
uses: actions/setup-node@v4
@@ -190,24 +191,25 @@ jobs:
190191
[ "${{ matrix.ARGS.indices }}" != "" ] && INDICES="--indices ${{ matrix.ARGS.indices }}"
191192
[ "${{ matrix.ARGS.concurrency }}" != "" ] && CONCURRENCY="--concurrency ${{ matrix.ARGS.concurrency }}"
192193
[ "${{ matrix.ARGS.platform }}" != "" ] && PLATFORM="--platform ${{ matrix.ARGS.platform }}"
193-
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME"
194+
[ "${{ matrix.ARGS.cache }}" == "true" ] && CACHE="--cache true"
195+
all_args="--browsers=chrome:devextreme-shr2 --componentFolder ${{ matrix.ARGS.componentFolder }} $CONCURRENCY $INDICES $PLATFORM $THEME $CACHE"
194196
echo "$all_args"
195197
pnpm run test $all_args
196198
197199
- name: Sanitize job name
198-
if: ${{ failure() }}
200+
if: ${{ always() }}
199201
run: echo "JOB_NAME=$(echo "${{ matrix.ARGS.name }}" | tr '/' '-')" >> $GITHUB_ENV
200202

201203
- name: Copy compared screenshot artifacts
202-
if: ${{ failure() }}
204+
if: ${{ always() }}
203205
uses: actions/upload-artifact@v4
204206
with:
205207
name: compared-screenshots-${{ env.JOB_NAME }}
206208
path: ${{ github.workspace }}/e2e/testcafe-devextreme/artifacts/compared-screenshots/**/*
207209
if-no-files-found: ignore
208210

209211
- name: Copy failed test artifacts
210-
if: ${{ failure() }}
212+
if: ${{ always() }}
211213
uses: actions/upload-artifact@v4
212214
with:
213215
name: failed-tests-${{ env.JOB_NAME }}
@@ -217,7 +219,7 @@ jobs:
217219
merge-artifacts:
218220
runs-on: devextreme-shr2
219221
needs: testcafe
220-
if: ${{ failure() }}
222+
if: ${{ always() }}
221223

222224
steps:
223225
- name: Merge screenshot artifacts

apps/demos/utils/visual-tests/testcafe-runner.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import createTestCafe from 'testcafe';
22
import { ClientFunction } from 'testcafe';
3-
import { THEME } from './helpers/theme-utils';
43
import fs from 'fs';
54

65
const LAUNCH_RETRY_ATTEMPTS = 3;
@@ -79,9 +78,7 @@ function accessibilityTestCafeReporter() {
7978
}
8079

8180
async function main() {
82-
const tester = await createTestCafe({
83-
cache: true,
84-
});
81+
const tester = await createTestCafe({});
8582
const runner = tester.createRunner();
8683
const concurrency = (process.env.CONCURRENCY && (+process.env.CONCURRENCY)) || 1;
8784

e2e/testcafe-devextreme/runner.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { getCurrentTheme } from './helpers/themeUtils';
1414

1515
const LAUNCH_RETRY_ATTEMPTS = 3;
1616
const LAUNCH_RETRY_TIMEOUT = 10000;
17-
const FAILED_TESTS_RETRY_ATTEMPTS = 2;
17+
const FAILED_TESTS_RETRY_ATTEMPTS = 3;
1818

1919
const wait = async (
2020
timeout: number,
@@ -58,12 +58,12 @@ interface ParsedArgs {
5858
retryFailed: boolean;
5959
}
6060

61-
const TESTCAFE_CONFIG: Partial<TestCafeConfigurationOptions> = {
61+
const getTestCafeConfig = (cache: boolean): Partial<TestCafeConfigurationOptions> => ({
6262
hostname: 'localhost',
6363
port1: 1437,
6464
port2: 1438,
65-
cache: true,
66-
};
65+
cache,
66+
});
6767

6868
const changeTheme = async (t: TestController, themeName: string): Promise<void> => {
6969
const changeThemeClientFn = ClientFunction(() => new Promise<void>((resolve) => {
@@ -106,7 +106,7 @@ function getArgs(): ParsedArgs {
106106
reporter: 'spec-time',
107107
componentFolder: '',
108108
file: '*',
109-
cache: true,
109+
cache: false,
110110
quarantineMode: false,
111111
indices: '',
112112
platform: '',
@@ -123,9 +123,8 @@ async function main() {
123123
let testCafe: Awaited<ReturnType<typeof createTestCafe>> | null = null;
124124

125125
try {
126-
testCafe = await createTestCafe(TESTCAFE_CONFIG);
127-
128126
const args = getArgs();
127+
testCafe = await createTestCafe(getTestCafeConfig(args.cache));
129128

130129
const testName = args.test.trim();
131130
const reporter = typeof args.reporter === 'string' ? args.reporter.trim() : args.reporter;
-105 Bytes
Loading
1.09 KB
Loading
-155 Bytes
Loading
1.07 KB
Loading

0 commit comments

Comments
 (0)