Increase waiting time liquid tests#256
Conversation
WalkthroughThis patch release extends the polling timeout in the test runner to reduce timeout errors during test execution. The code change doubles the waiting limit threshold, accompanied by a version bump to 1.56.1 and corresponding changelog documentation. ChangesTest Run Timeout Extension (v1.56.1 patch)
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/liquidTestRunner.js (1)
311-334: ⚡ Quick winConsider adding progress logging for long-running tests.
With the timeout now at 33+ minutes, users may wait a long time without feedback. Consider adding periodic log messages (e.g., "Still running tests... (15 minutes elapsed)") to reassure users that the process hasn't stalled.
💡 Suggested enhancement
async function fetchResult(firmId, testRunId, templateType) { let testRun = { status: "started" }; let pollingDelay = 1000; const waitingLimit = 2000000; + const logIntervals = [600000, 1200000, 1800000]; // 10, 20, 30 minutes + let nextLogIndex = 0; spinner.spin("Running tests.."); let waitingTime = 0; while (testRun.status === "started") { await new Promise((resolve) => { setTimeout(resolve, pollingDelay); }); const response = await SF.readTestRun(firmId, testRunId, templateType); testRun = response.data; waitingTime += pollingDelay; pollingDelay *= 1.05; + + if (nextLogIndex < logIntervals.length && waitingTime >= logIntervals[nextLogIndex]) { + spinner.stop(); + consola.info(`Still running tests... (${Math.floor(waitingTime / 60000)} minutes elapsed)`); + spinner.spin("Running tests.."); + nextLogIndex++; + } + if (waitingTime >= waitingLimit) { spinner.stop(); consola.error("Timeout. Try to run your test again"); break; } } spinner.stop(); return testRun; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/liquidTestRunner.js` around lines 311 - 334, The fetchResult loop can leave users waiting without feedback; add periodic progress logs by introducing a lastLogged timestamp and a logInterval (e.g., 5 minutes) inside the while (testRun.status === "started") loop, and when waitingTime - lastLogged >= logInterval call consola.info with a message like "Still running tests... (X minutes elapsed)" (compute X from waitingTime), then update lastLogged; keep spinner behavior unchanged and ensure variables referenced are fetchResult, waitingTime, pollingDelay, lastLogged, and logInterval.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@lib/liquidTestRunner.js`:
- Around line 311-334: The fetchResult loop can leave users waiting without
feedback; add periodic progress logs by introducing a lastLogged timestamp and a
logInterval (e.g., 5 minutes) inside the while (testRun.status === "started")
loop, and when waitingTime - lastLogged >= logInterval call consola.info with a
message like "Still running tests... (X minutes elapsed)" (compute X from
waitingTime), then update lastLogged; keep spinner behavior unchanged and ensure
variables referenced are fetchResult, waitingTime, pollingDelay, lastLogged, and
logInterval.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6e6e667a-6aca-454f-9a91-6017171959e2
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
CHANGELOG.mdlib/liquidTestRunner.jspackage.json
Fixes # (link to the corresponding issue if applicable)
Description
Some large PR's keep having failed liquid test runs because a lot of files were touched. If the tests run > 16 mins, the test run crashes, making merging very hard.
Testing Instructions
Steps:
Author Checklist
Reviewer Checklist