From 31af991bcb6424221eaf52c99e8888362491b063 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 25 Oct 2026 01:00:01 +0000 Subject: [PATCH] Skip the million-row TreeDataGrid test in WebKit WebKit lays out each row track of the grid, so the million rows of this test take ~250ms per layout and ~1 GB of memory, over half of which the page keeps. The tested code doesn't depend on the browser, and Chromium and Firefox have lower argument limits. Co-Authored-By: Claude Opus 5.5 --- test/browser/TreeDataGrid.test.tsx | 59 +++++++++++++++++------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/test/browser/TreeDataGrid.test.tsx b/test/browser/TreeDataGrid.test.tsx index efbaac9de0..94134d89d5 100644 --- a/test/browser/TreeDataGrid.test.tsx +++ b/test/browser/TreeDataGrid.test.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { page, userEvent } from 'vite-plus/test/browser'; +import { page, server, userEvent } from 'vite-plus/test/browser'; import type { Column } from '../../src'; import { renderTextEditor, SelectColumn, TreeDataGrid } from '../../src'; @@ -222,32 +222,39 @@ test('should use groupBy order while grouping', async () => { await testRowCount(5); }); -test('should expand a group with more rows than a function call can take as arguments', async () => { - // browsers limit the number of arguments, e.g., in `push(...childRows)`, and a million is above all of their limits - const rows = Array.from({ length: 1_000_000 }, (_, id): Row => ({ - id, - country: 'USA', - year: 2020 - })); - - await page.render( - {}} - /> - ); +// WebKit lays out each row track of the grid, so a million rows take ~250ms per layout +// and ~1 GB of memory, and the page keeps over half of it after the test. +// The tested code doesn't depend on the browser, and Chromium and Firefox have lower limits. +test( + 'should expand a group with more rows than a function call can take as arguments', + { skip: server.browser === 'webkit' }, + async () => { + // browsers limit the number of arguments, e.g., in `push(...childRows)`, and a million is above all of their limits + const rows = Array.from({ length: 1_000_000 }, (_, id): Row => ({ + id, + country: 'USA', + year: 2020 + })); + + await page.render( + {}} + /> + ); - // the header row, the group row, and the rows of the group - await expect.element(treeGrid).toHaveAttribute('aria-rowcount', '1000002'); - // the row count doesn't depend on the expanded state, so also check that the rows were added - await expect.element(page.getCell({ name: '0', exact: true })).toBeVisible(); -}); + // the header row, the group row, and the rows of the group + await expect.element(treeGrid).toHaveAttribute('aria-rowcount', '1000002'); + // the row count doesn't depend on the expanded state, so also check that the rows were added + await expect.element(page.getCell({ name: '0', exact: true })).toBeVisible(); + } +); test('should keep the row keys when an earlier group is expanded, without rowKeyGetter', async () => { function Test() {