Skip to content

fix(cli): replace cli-table3 wordWrap with CLITable wrapper#2715

Open
iliya-i wants to merge 6 commits intomainfrom
iliya/eng-9316-wgc-router-deadlock
Open

fix(cli): replace cli-table3 wordWrap with CLITable wrapper#2715
iliya-i wants to merge 6 commits intomainfrom
iliya/eng-9316-wgc-router-deadlock

Conversation

@iliya-i
Copy link
Copy Markdown

@iliya-i iliya-i commented Mar 31, 2026

Summary

Fixes #2619 cli-table3's built-in wordWrap option uses string-width which executes emoji-regex on every word in every table cell. Rendering time grows super-linearly with text volume, causing the CLI process to hang indefinitely when composition errors produce large output.

This PR introduces a CLITable wrapper class that replaces cli-table3's wordWrap with a lightweight wrapText utility that breaks text on word boundaries using simple character counting. The wrapper automatically wraps all string cells based on their column width, so developers never need to think about it.

  • cli/src/wrap-text.ts: text wrapping utility
  • cli/src/cli-table.ts: CLITable class that wraps cli-table3, automatically applies wrapText per column based on colWidths, omits wordWrap and wrapOnWordBoundary from the type to prevent misuse
  • Replaced all new Table / wordWrap: true usages
  • Column overhead is derived from the cli-table3 instance style

Based on the root cause analysis and wrapText utility from @kamil-gwozdz in #2620.

Summary by CodeRabbit

  • New Features

    • Deterministic CLI text wrapping and a unified table renderer for clearer console output across commands
  • Bug Fixes

    • Prevented hangs and improved performance when rendering very large error messages
  • Tests

    • Added regression and performance tests to validate wrapping behavior and guard against future hangs

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/docs-website.
  • I have read the Contributors Guide.

Open Source AI Manifesto

This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8eef941c-7b73-40a9-be7d-5a099b55dc8a

📥 Commits

Reviewing files that changed from the base of the PR and between 446bc08 and 0598b8a.

📒 Files selected for processing (1)
  • cli/test/cli-table.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • cli/test/cli-table.test.ts

Walkthrough

Replaces cli-table3 word-wrapping with a deterministic per-cell wrapper: adds wrapText and CLITable, swaps CLI uses of cli-table3CLITable (removing wordWrap/wrapOnWordBoundary), and adds unit and regression tests for correctness and large-text performance.

Changes

Cohort / File(s) Summary
New CLI utilities
cli/src/wrap-text.ts, cli/src/cli-table.ts
Add wrapText(text, maxWidth) and CLITable (new CLITableOptions omits wordWrap/wrapOnWordBoundary, supports columnOverhead) implementing deterministic per-cell wrapping and delegating rendering to cli-table3 without its expensive wordWrap path.
CLI command table replacements
cli/src/commands/contract/commands/create.ts, cli/src/commands/contract/commands/update.ts, cli/src/commands/feature-flag/commands/list.ts, cli/src/commands/graph/common/version/commands/get.ts, cli/src/commands/graph/common/version/commands/set.ts, cli/src/commands/graph/federated-graph/commands/..., cli/src/commands/graph/monograph/commands/..., cli/src/commands/grpc-service/commands/..., cli/src/commands/namespace/commands/list.ts, cli/src/commands/router/commands/..., cli/src/commands/subgraph/commands/...
Replace cli-table3 Table with project CLITable across many command files; remove wordWrap/wrapOnWordBoundary options, keep headers/colWidths/rows and toString() usage.
Shared CLI handlers updated
cli/src/handle-check-result.ts, cli/src/handle-composition-result.ts, cli/src/handle-proposal-result.ts
Switch shared table-rendering to CLITable, removing wordWrap usage while preserving headers, columns, and output flows.
Minor cleanup
cli/src/commands/graph/monograph/commands/move.ts
Remove unused imports (CliTable3, program) with no behavioral change.
Tests added
cli/test/wrap-text.test.ts, cli/test/cli-table.test.ts, cli/test/compose-error-table.test.ts
Add unit and regression tests for wrapText and CLITable, including large-text performance/regression checks that exercise previously hanging scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: replacing cli-table3's wordWrap functionality with a new CLITable wrapper, which directly addresses the issue being fixed.
Linked Issues check ✅ Passed The PR implements all coding objectives from issue #2619: introduces wrapText utility for performant text wrapping, creates CLITable wrapper to avoid wordWrap, and replaces all Table usages across the codebase with CLITable.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing issue #2619: new utilities (wrapText, CLITable), corresponding tests, and systematic replacement of Table usage with CLITable across CLI commands. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 60.78431% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.93%. Comparing base (8529b07) to head (0598b8a).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rc/commands/graph/federated-graph/commands/move.ts 16.66% 5 Missing ⚠️
cli/src/handle-proposal-result.ts 0.00% 5 Missing ⚠️
cli/src/commands/router/commands/compose.ts 20.00% 4 Missing ⚠️
cli/src/commands/contract/commands/create.ts 25.00% 3 Missing ⚠️
cli/src/commands/contract/commands/update.ts 25.00% 3 Missing ⚠️
.../commands/graph/federated-graph/commands/create.ts 25.00% 3 Missing ⚠️
.../commands/graph/federated-graph/commands/update.ts 25.00% 3 Missing ⚠️
...i/src/commands/graph/monograph/commands/publish.ts 25.00% 3 Missing ⚠️
cli/src/commands/grpc-service/commands/delete.ts 25.00% 3 Missing ⚠️
cli/src/commands/grpc-service/commands/publish.ts 25.00% 3 Missing ⚠️
... and 14 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2715       +/-   ##
===========================================
- Coverage   63.14%   35.93%   -27.22%     
===========================================
  Files         249      131      -118     
  Lines       26661    11755    -14906     
  Branches        0      486      +486     
===========================================
- Hits        16835     4224    -12611     
+ Misses       8449     7529      -920     
+ Partials     1377        2     -1375     
Files with missing lines Coverage Δ
cli/src/cli-table.ts 100.00% <100.00%> (ø)
...c/commands/graph/federated-graph/commands/check.ts 60.00% <100.00%> (ø)
cli/src/commands/graph/monograph/commands/move.ts 48.38% <100.00%> (ø)
cli/src/commands/subgraph/commands/publish.ts 86.29% <100.00%> (ø)
cli/src/handle-check-result.ts 97.63% <100.00%> (ø)
cli/src/handle-composition-result.ts 73.11% <100.00%> (ø)
cli/src/wrap-text.ts 100.00% <100.00%> (ø)
cli/src/commands/feature-flag/commands/list.ts 29.16% <50.00%> (ø)
.../src/commands/graph/common/version/commands/get.ts 39.47% <50.00%> (ø)
...rc/commands/graph/federated-graph/commands/list.ts 20.40% <50.00%> (ø)
... and 21 more

... and 349 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
cli/src/handle-proposal-result.ts (1)

19-57: Consider adding colWidths for non-composition proposal tables to retain bounded wrapping.

CLITable wraps only when a numeric column width is provided. For changesTable, lintIssuesTable, and graphPruningIssuesTable, long messages can now spill into very wide rows.

Suggested adjustment
   const changesTable = new CLITable({
     head: [
       pc.bold(pc.white('SUBGRAPH_NAME')),
       pc.bold(pc.white('CHANGE')),
       pc.bold(pc.white('TYPE')),
       pc.bold(pc.white('DESCRIPTION')),
     ],
+    colWidths: [24, 16, 22, 120],
   });
@@
   const lintIssuesTable = new CLITable({
@@
-    colAligns: ['left', 'left', 'center'],
+    colAligns: ['left', 'left', 'left', 'center'],
+    colWidths: [24, 24, 120, 14],
   });
@@
   const graphPruningIssuesTable = new CLITable({
@@
-    colAligns: ['left', 'left', 'left', 'center'],
+    colAligns: ['left', 'left', 'left', 'left', 'center'],
+    colWidths: [24, 24, 48, 96, 14],
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/handle-proposal-result.ts` around lines 19 - 57, The tables
changesTable, lintIssuesTable, and graphPruningIssuesTable lack numeric
colWidths so long cells can expand rows; update their CLITable constructors
(referencing changesTable, lintIssuesTable, graphPruningIssuesTable) to include
a colWidths array with sensible numeric widths for the long text columns (e.g.,
DESCRIPTION in changesTable; ERROR_MESSAGE and LINE NUMBER in lintIssuesTable;
FIELD_PATH, MESSAGE and LINE NUMBER in graphPruningIssuesTable) to enable proper
wrapping and keep rows bounded while preserving alignment for shorter columns
like SUBGRAPH_NAME and RULE.
cli/src/cli-table.ts (1)

26-39: Consider guarding against non-positive effective width.

If columnOverhead >= width, wrapText receives a non-positive maxWidth. While wrapText handles this gracefully (words are emitted without wrapping), this could cause unexpected table rendering if callers misconfigure colWidths. A defensive check or warning might be valuable for debuggability.

🛡️ Optional: Add a defensive minimum width
           if (typeof cell === 'string' && typeof width === 'number') {
-              return wrapText(cell, width - this.columnOverhead);
+              const effectiveWidth = Math.max(1, width - this.columnOverhead);
+              return wrapText(cell, effectiveWidth);
           }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/src/cli-table.ts` around lines 26 - 39, In push([...]) when computing
wrap width for each cell, guard against non-positive effective width by
computing const effectiveWidth = (typeof width === 'number') ? width -
this.columnOverhead : undefined and if effectiveWidth === undefined or
effectiveWidth < 1 then either clamp it to 1 before calling wrapText or emit a
short warning (e.g., console.warn) referencing the offending column index;
update the push method (referencing push, this.colWidths, this.columnOverhead,
wrapText) so wrapText is never called with a non-positive maxWidth and callers
get a debuggable warning instead of silent odd rendering.
cli/test/compose-error-table.test.ts (1)

61-79: Test may be flaky with such small input size.

With only 500 bytes of text, both buggyMs and fixedMs could be 0ms on fast hardware, making the assertion fixedMs < buggyMs fail (0 < 0 is false). Consider increasing the text size or asserting a minimum threshold to make the test more robust.

♻️ Suggested fix to increase input size for reliable timing
   test('cli-table3 wordWrap is too slow for large error text (demonstrates the bug)', () => {
-    const text = generateLargeErrorMessage(500);
+    const text = generateLargeErrorMessage(10_000);

     // Measure the buggy path: cli-table3 wordWrap: true
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/test/compose-error-table.test.ts` around lines 61 - 79, The timing test
is flaky because generateLargeErrorMessage(500) can produce 0ms timings on fast
machines; increase the input size (e.g., replace generateLargeErrorMessage(500)
with a much larger value like 50000) so buggyMs and fixedMs are measurable, and
add a guard assertion such as expect(buggyMs).toBeGreaterThan(0) before
asserting expect(fixedMs).toBeLessThan(buggyMs) to avoid 0<0 failures; modify
the test that references generateLargeErrorMessage, wrapText,
TABLE_CONTENT_WIDTH, buggyMs and fixedMs accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cli/src/commands/graph/federated-graph/commands/move.ts`:
- Around line 102-109: The CLITable instantiation for compositionWarningsTable
has 3 headers but 4 colWidths entries; update the colWidths array in the
compositionWarningsTable CLITable call to match the three headers (e.g., remove
the extra fourth value so it becomes [30, 30, 120] or adjust widths to desired
three-column widths) inside the move.ts file where compositionWarningsTable is
created to ensure the number of colWidths aligns with the header array.
- Around line 39-46: The CLITable instance compositionErrorsTable defines three
headers (FEDERATED_GRAPH_NAME, NAMESPACE, ERROR_MESSAGE) but colWidths only
contains two entries; update the colWidths array on compositionErrorsTable to
have three numeric widths (or remove colWidths to use automatic sizing) so it
matches the three head columns—look for the CLITable constructor call that
creates compositionErrorsTable and adjust the colWidths value accordingly.

---

Nitpick comments:
In `@cli/src/cli-table.ts`:
- Around line 26-39: In push([...]) when computing wrap width for each cell,
guard against non-positive effective width by computing const effectiveWidth =
(typeof width === 'number') ? width - this.columnOverhead : undefined and if
effectiveWidth === undefined or effectiveWidth < 1 then either clamp it to 1
before calling wrapText or emit a short warning (e.g., console.warn) referencing
the offending column index; update the push method (referencing push,
this.colWidths, this.columnOverhead, wrapText) so wrapText is never called with
a non-positive maxWidth and callers get a debuggable warning instead of silent
odd rendering.

In `@cli/src/handle-proposal-result.ts`:
- Around line 19-57: The tables changesTable, lintIssuesTable, and
graphPruningIssuesTable lack numeric colWidths so long cells can expand rows;
update their CLITable constructors (referencing changesTable, lintIssuesTable,
graphPruningIssuesTable) to include a colWidths array with sensible numeric
widths for the long text columns (e.g., DESCRIPTION in changesTable;
ERROR_MESSAGE and LINE NUMBER in lintIssuesTable; FIELD_PATH, MESSAGE and LINE
NUMBER in graphPruningIssuesTable) to enable proper wrapping and keep rows
bounded while preserving alignment for shorter columns like SUBGRAPH_NAME and
RULE.

In `@cli/test/compose-error-table.test.ts`:
- Around line 61-79: The timing test is flaky because
generateLargeErrorMessage(500) can produce 0ms timings on fast machines;
increase the input size (e.g., replace generateLargeErrorMessage(500) with a
much larger value like 50000) so buggyMs and fixedMs are measurable, and add a
guard assertion such as expect(buggyMs).toBeGreaterThan(0) before asserting
expect(fixedMs).toBeLessThan(buggyMs) to avoid 0<0 failures; modify the test
that references generateLargeErrorMessage, wrapText, TABLE_CONTENT_WIDTH,
buggyMs and fixedMs accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37ab2a55-bd6c-49b9-8021-5ecc036a8cc8

📥 Commits

Reviewing files that changed from the base of the PR and between 4e2b146 and 4dcf400.

📒 Files selected for processing (34)
  • cli/src/cli-table.ts
  • cli/src/commands/contract/commands/create.ts
  • cli/src/commands/contract/commands/update.ts
  • cli/src/commands/feature-flag/commands/list.ts
  • cli/src/commands/graph/common/version/commands/get.ts
  • cli/src/commands/graph/common/version/commands/set.ts
  • cli/src/commands/graph/federated-graph/commands/check.ts
  • cli/src/commands/graph/federated-graph/commands/create.ts
  • cli/src/commands/graph/federated-graph/commands/list.ts
  • cli/src/commands/graph/federated-graph/commands/move.ts
  • cli/src/commands/graph/federated-graph/commands/update.ts
  • cli/src/commands/graph/monograph/commands/list.ts
  • cli/src/commands/graph/monograph/commands/move.ts
  • cli/src/commands/graph/monograph/commands/publish.ts
  • cli/src/commands/grpc-service/commands/delete.ts
  • cli/src/commands/grpc-service/commands/publish.ts
  • cli/src/commands/namespace/commands/list.ts
  • cli/src/commands/router/commands/compatibility-version/commands/list.ts
  • cli/src/commands/router/commands/compose.ts
  • cli/src/commands/router/commands/plugin/commands/delete.ts
  • cli/src/commands/router/commands/plugin/commands/publish.ts
  • cli/src/commands/router/commands/token/commands/list.ts
  • cli/src/commands/subgraph/commands/delete.ts
  • cli/src/commands/subgraph/commands/list.ts
  • cli/src/commands/subgraph/commands/move.ts
  • cli/src/commands/subgraph/commands/publish.ts
  • cli/src/commands/subgraph/commands/update.ts
  • cli/src/handle-check-result.ts
  • cli/src/handle-composition-result.ts
  • cli/src/handle-proposal-result.ts
  • cli/src/wrap-text.ts
  • cli/test/cli-table.test.ts
  • cli/test/compose-error-table.test.ts
  • cli/test/wrap-text.test.ts

Comment on lines +12 to +44
export class CLITable {
private table: InstanceType<typeof Table>;
private colWidths: (number | null)[] | undefined;
private columnOverhead: number;

constructor(options: CLITableOptions = {}) {
const { columnOverhead, ...tableOptions } = options;
this.table = new Table(tableOptions);
this.colWidths = tableOptions.colWidths;

const { style } = this.table.options;
this.columnOverhead = columnOverhead ?? style['padding-left'] + style['padding-right'];
}

push(...rows: Cell[][]): void {
for (const row of rows) {
const wrapped = this.colWidths
? row.map((cell, i) => {
const width = this.colWidths![i];
if (typeof cell === 'string' && typeof width === 'number') {
return wrapText(cell, width - this.columnOverhead);
}
return cell;
})
: row;
this.table.push(wrapped);
}
}

toString(): string {
return this.table.toString();
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do export ... as Table instead of changing every import to CLITable this would shrink the diff by a lot

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@endigma I made it different on purpose, since exporting as Table could be confused with the original cli-table3 package, but I can change it feel strongly about reducing the diff?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

more a nit than anything, up to you

Copy link
Copy Markdown
Contributor

@comatory comatory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few suggestions

expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith('wrapped', 30 - DEFAULT_OVERHEAD);

spy.mockRestore();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vite.config.ts has restoreMocks: true so this should not be needed

* This avoids cli-table3's built-in wordWrap which can deadlock due to
* expensive string-width/emoji-regex evaluations on large inputs (#2619).
*/
export function wrapText(text: string, maxWidth: number): string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is used internally within just the table class right? Why not make it part of the class itself. It does not have access to this so it could be a static method. We can keep separate tests for it in extra describe block in cli-table.test.ts WDYT?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this way it's a pure function and it's much easier to test

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cli/test/cli-table.test.ts`:
- Around line 18-23: Remove the extra blank lines before the test block closers
so the padded-blocks ESLint rule passes; in cli/test/cli-table.test.ts collapse
the blank line(s) immediately before the closing "});" after the expect
assertions (the blocks containing expect(spy).toHaveBeenCalledTimes(2) /
expect(spy).toHaveBeenCalledWith(...)) so there is no empty line between the
last statement and the "});" in both affected test cases.
- Around line 40-51: The deadlock regression test "does not deadlock on large
text (`#2619`)" uses too-small payload and a brittle wall-clock assertion; update
the test that constructs CLITable and largeText to use a much larger payload
(e.g., increase the repeat count substantially) and remove the elapsed time
assertion (expect(elapsed).toBeLessThan(500)), relying on the existing test
timeout (5000ms) to detect hangs instead; keep references to CLITable,
largeText, and the test name so the change is applied to the correct test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 10a479f0-df4b-45b3-9570-bd74e984fbab

📥 Commits

Reviewing files that changed from the base of the PR and between 77ca090 and 446bc08.

📒 Files selected for processing (1)
  • cli/test/cli-table.test.ts

Comment on lines +40 to +51
test('does not deadlock on large text (#2619)', () => {
const table = new CLITable({
head: ['ERROR_MESSAGE'],
colWidths: [120],
});
const largeText = 'error '.repeat(100).trim();
const t0 = Date.now();
table.push([largeText]);
table.toString();
const elapsed = Date.now() - t0;
expect(elapsed).toBeLessThan(500);
}, 5000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Strengthen the deadlock regression and remove timing flakiness.

At Line 45, repeat(100) is too small for the large-output scenario, and Line 50’s <500ms wall-clock assertion is brittle across CI runners. Use a much larger payload and rely on the test timeout to catch hangs.

Proposed regression-test adjustment
   test('does not deadlock on large text (`#2619`)', () => {
@@
-    const largeText = 'error '.repeat(100).trim();
-    const t0 = Date.now();
-    table.push([largeText]);
-    table.toString();
-    const elapsed = Date.now() - t0;
-    expect(elapsed).toBeLessThan(500);
+    const largeText = 'error '.repeat(200_000).trim();
+    expect(() => {
+      table.push([largeText]);
+      table.toString();
+    }).not.toThrow();
   }, 5000);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/test/cli-table.test.ts` around lines 40 - 51, The deadlock regression
test "does not deadlock on large text (`#2619`)" uses too-small payload and a
brittle wall-clock assertion; update the test that constructs CLITable and
largeText to use a much larger payload (e.g., increase the repeat count
substantially) and remove the elapsed time assertion
(expect(elapsed).toBeLessThan(500)), relying on the existing test timeout
(5000ms) to detect hangs instead; keep references to CLITable, largeText, and
the test name so the change is applied to the correct test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wgc router compose hangs indefinitely when composition errors produce large error text

3 participants