Skip to content

Commit 3fec51f

Browse files
committed
fix: change timeout per char
1 parent ddeed7b commit 3fec51f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

scripts/test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const nodeArgs = [
5353
'spec',
5454
'--test-force-exit',
5555
'--test',
56-
'--test-timeout=30000',
56+
'--test-timeout=60000',
5757
...flags,
5858
...files,
5959
];

src/tools/input.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,10 @@ async function fillFormElement(
160160
await selectOption(handle, aXNode, value);
161161
} else {
162162
// Increase timeout for longer input values.
163-
const textLengthIn1kChars = Math.floor(value.length / 1_000);
164-
const timeoutPer1kChars = 5_000; // ms
163+
const timeoutPerChar = 10; // ms
165164
const fillTimeout =
166165
context.getSelectedPage().getDefaultTimeout() +
167-
textLengthIn1kChars * timeoutPer1kChars;
166+
value.length * timeoutPerChar;
168167
await handle.asLocator().setTimeout(fillTimeout).fill(value);
169168
}
170169
} finally {

tests/tools/performance.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('performance', () => {
140140
});
141141
});
142142

143-
it.only('supports filePath', async () => {
143+
it('supports filePath', async () => {
144144
const rawData = loadTraceAsBuffer('basic-trace.json.gz');
145145
// rawData is the decompressed buffer (based on loadTraceAsBuffer implementation).
146146
// We want to simulate saving it as a .gz file, so the tool should compress it.

0 commit comments

Comments
 (0)