Skip to content

Commit a206fbd

Browse files
committed
Prefer JSX in ReactNoop assertions (to combat out-of-memory test runs) (#26127)
## Summary Prefer `getChildrenAsJSX` or `toMatchRenderedOutput` over `getChildren`. Use `dangerouslyGetChildren` if you really need to (e.g. for `toBe` assertions). Prefer `getPendingChildrenAsJSX` over `getPendingChildren`. Use `dangerouslyGetPendingChildren` if you really need to (e.g. for `toBe` assertions). `ReactNoop.getChildren` contains the fibers as non-enumerable properties. If you pass the children to `toEqual` and have a mismatch, Jest performance is very poor (to the point of causing out-of-memory crashes e.g. https://app.circleci.com/pipelines/github/facebook/react/38084/workflows/02ca0cbb-bab4-4c19-8d7d-ada814eeebb9/jobs/624297/parallel-runs/5?filterBy=ALL&invite=true#step-106-27). Mismatches can sometimes be intended e.g. on gated tests. Instead, I converted almost all of the `toEqual` assertions to `toMatchRenderedOutput` assertions or compare the JSX instead. For ReactNoopPersistent we still use `getChildren` since we have assertions on referential equality. `toMatchRenderedOutput` is more accurate in some instances anyway. I highlighted some of those more accurate assertions in review-comments. ## How did you test this change? - [x] `CIRCLE_NODE_TOTAL=20 CIRCLE_NODE_INDEX=5 yarn test -r=experimental --env=development --ci`: Can take up to 350s (and use up to 7GB of memory) on `main` but 11s on this branch - [x] No more slow `yarn test` parallel runs of `yarn_test` jobs (the steps in these runs should take <1min but sometimes they take 3min and end with OOM like https://app.circleci.com/pipelines/github/facebook/react/38084/workflows/02ca0cbb-bab4-4c19-8d7d-ada814eeebb9/jobs/624258/parallel-runs/5?filterBy=ALL: Looks good with a sample size of 1 https://app.circleci.com/pipelines/github/facebook/react/38110/workflows/745109a2-b86b-429f-8c01-9b23a245417a/jobs/624651 DiffTrain build for [3ff1540](3ff1540) [View git log for this commit](https://github.com/facebook/react/commits/3ff1540e9bbe30aae52e2c9ab61c843bd0c94237)
1 parent cbbf551 commit a206fbd

28 files changed

+42
-42
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
78d2e9e2a894a7ea9aa3f9faadfc4c6038e86a75
1+
3ff1540e9bbe30aae52e2c9ab61c843bd0c94237
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
78d2e9e2a894a7ea9aa3f9faadfc4c6038e86a75
1+
3ff1540e9bbe30aae52e2c9ab61c843bd0c94237

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-classic-78d2e9e2a-20230208";
30+
var ReactVersion = "18.3.0-www-classic-3ff1540e9-20230209";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-78d2e9e2a-20230208";
30+
var ReactVersion = "18.3.0-www-modern-3ff1540e9-20230209";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,4 +646,4 @@ exports.useSyncExternalStore = function (
646646
);
647647
};
648648
exports.useTransition = useTransition;
649-
exports.version = "18.3.0-www-classic-78d2e9e2a-20230208";
649+
exports.version = "18.3.0-www-classic-3ff1540e9-20230209";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,4 +638,4 @@ exports.useSyncExternalStore = function (
638638
);
639639
};
640640
exports.useTransition = useTransition;
641-
exports.version = "18.3.0-www-modern-78d2e9e2a-20230208";
641+
exports.version = "18.3.0-www-modern-3ff1540e9-20230209";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ exports.useSyncExternalStore = function (
657657
);
658658
};
659659
exports.useTransition = useTransition;
660-
exports.version = "18.3.0-www-classic-78d2e9e2a-20230208";
660+
exports.version = "18.3.0-www-classic-3ff1540e9-20230209";
661661

662662
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
663663
if (

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ exports.useSyncExternalStore = function (
649649
);
650650
};
651651
exports.useTransition = useTransition;
652-
exports.version = "18.3.0-www-modern-78d2e9e2a-20230208";
652+
exports.version = "18.3.0-www-modern-3ff1540e9-20230209";
653653

654654
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
655655
if (

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-classic-78d2e9e2a-20230208";
72+
var ReactVersion = "18.3.0-www-classic-3ff1540e9-20230209";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
6969
return self;
7070
}
7171

72-
var ReactVersion = "18.3.0-www-modern-78d2e9e2a-20230208";
72+
var ReactVersion = "18.3.0-www-modern-3ff1540e9-20230209";
7373

7474
var LegacyRoot = 0;
7575
var ConcurrentRoot = 1;

compiled/facebook-www/ReactART-prod.classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9845,7 +9845,7 @@ var slice = Array.prototype.slice,
98459845
return null;
98469846
},
98479847
bundleType: 0,
9848-
version: "18.3.0-www-classic-78d2e9e2a-20230208",
9848+
version: "18.3.0-www-classic-3ff1540e9-20230209",
98499849
rendererPackageName: "react-art"
98509850
};
98519851
var internals$jscomp$inline_1318 = {
@@ -9876,7 +9876,7 @@ var internals$jscomp$inline_1318 = {
98769876
scheduleRoot: null,
98779877
setRefreshHandler: null,
98789878
getCurrentFiber: null,
9879-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
9879+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
98809880
};
98819881
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
98829882
var hook$jscomp$inline_1319 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactART-prod.modern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9510,7 +9510,7 @@ var slice = Array.prototype.slice,
95109510
return null;
95119511
},
95129512
bundleType: 0,
9513-
version: "18.3.0-www-modern-78d2e9e2a-20230208",
9513+
version: "18.3.0-www-modern-3ff1540e9-20230209",
95149514
rendererPackageName: "react-art"
95159515
};
95169516
var internals$jscomp$inline_1309 = {
@@ -9541,7 +9541,7 @@ var internals$jscomp$inline_1309 = {
95419541
scheduleRoot: null,
95429542
setRefreshHandler: null,
95439543
getCurrentFiber: null,
9544-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
9544+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
95459545
};
95469546
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
95479547
var hook$jscomp$inline_1310 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled/facebook-www/ReactDOM-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42695,7 +42695,7 @@ function createFiberRoot(
4269542695
return root;
4269642696
}
4269742697

42698-
var ReactVersion = "18.3.0-www-classic-78d2e9e2a-20230208";
42698+
var ReactVersion = "18.3.0-www-classic-3ff1540e9-20230209";
4269942699

4270042700
function createPortal(
4270142701
children,

compiled/facebook-www/ReactDOM-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42419,7 +42419,7 @@ function createFiberRoot(
4241942419
return root;
4242042420
}
4242142421

42422-
var ReactVersion = "18.3.0-www-modern-78d2e9e2a-20230208";
42422+
var ReactVersion = "18.3.0-www-modern-3ff1540e9-20230209";
4242342423

4242442424
function createPortal(
4242542425
children,

compiled/facebook-www/ReactDOM-prod.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15575,7 +15575,7 @@ Internals.Events = [
1557515575
var devToolsConfig$jscomp$inline_1750 = {
1557615576
findFiberByHostInstance: getClosestInstanceFromNode,
1557715577
bundleType: 0,
15578-
version: "18.3.0-www-classic-78d2e9e2a-20230208",
15578+
version: "18.3.0-www-classic-3ff1540e9-20230209",
1557915579
rendererPackageName: "react-dom"
1558015580
};
1558115581
var internals$jscomp$inline_2134 = {
@@ -15605,7 +15605,7 @@ var internals$jscomp$inline_2134 = {
1560515605
scheduleRoot: null,
1560615606
setRefreshHandler: null,
1560715607
getCurrentFiber: null,
15608-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
15608+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
1560915609
};
1561015610
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1561115611
var hook$jscomp$inline_2135 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15853,4 +15853,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
1585315853
);
1585415854
};
1585515855
exports.unstable_runWithPriority = runWithPriority;
15856-
exports.version = "18.3.0-next-78d2e9e2a-20230208";
15856+
exports.version = "18.3.0-next-3ff1540e9-20230209";

compiled/facebook-www/ReactDOM-prod.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15136,7 +15136,7 @@ Internals.Events = [
1513615136
var devToolsConfig$jscomp$inline_1718 = {
1513715137
findFiberByHostInstance: getClosestInstanceFromNode,
1513815138
bundleType: 0,
15139-
version: "18.3.0-www-modern-78d2e9e2a-20230208",
15139+
version: "18.3.0-www-modern-3ff1540e9-20230209",
1514015140
rendererPackageName: "react-dom"
1514115141
};
1514215142
var internals$jscomp$inline_2109 = {
@@ -15167,7 +15167,7 @@ var internals$jscomp$inline_2109 = {
1516715167
scheduleRoot: null,
1516815168
setRefreshHandler: null,
1516915169
getCurrentFiber: null,
15170-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
15170+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
1517115171
};
1517215172
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1517315173
var hook$jscomp$inline_2110 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -15355,4 +15355,4 @@ exports.unstable_flushControlled = function (fn) {
1535515355
}
1535615356
};
1535715357
exports.unstable_runWithPriority = runWithPriority;
15358-
exports.version = "18.3.0-next-78d2e9e2a-20230208";
15358+
exports.version = "18.3.0-next-3ff1540e9-20230209";

compiled/facebook-www/ReactDOM-profiling.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16345,7 +16345,7 @@ Internals.Events = [
1634516345
var devToolsConfig$jscomp$inline_1824 = {
1634616346
findFiberByHostInstance: getClosestInstanceFromNode,
1634716347
bundleType: 0,
16348-
version: "18.3.0-www-classic-78d2e9e2a-20230208",
16348+
version: "18.3.0-www-classic-3ff1540e9-20230209",
1634916349
rendererPackageName: "react-dom"
1635016350
};
1635116351
(function (internals) {
@@ -16389,7 +16389,7 @@ var devToolsConfig$jscomp$inline_1824 = {
1638916389
scheduleRoot: null,
1639016390
setRefreshHandler: null,
1639116391
getCurrentFiber: null,
16392-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
16392+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
1639316393
});
1639416394
assign(Internals, {
1639516395
ReactBrowserEventEmitter: {
@@ -16624,7 +16624,7 @@ exports.unstable_renderSubtreeIntoContainer = function (
1662416624
);
1662516625
};
1662616626
exports.unstable_runWithPriority = runWithPriority;
16627-
exports.version = "18.3.0-next-78d2e9e2a-20230208";
16627+
exports.version = "18.3.0-next-3ff1540e9-20230209";
1662816628

1662916629
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1663016630
if (

compiled/facebook-www/ReactDOM-profiling.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15896,7 +15896,7 @@ Internals.Events = [
1589615896
var devToolsConfig$jscomp$inline_1792 = {
1589715897
findFiberByHostInstance: getClosestInstanceFromNode,
1589815898
bundleType: 0,
15899-
version: "18.3.0-www-modern-78d2e9e2a-20230208",
15899+
version: "18.3.0-www-modern-3ff1540e9-20230209",
1590015900
rendererPackageName: "react-dom"
1590115901
};
1590215902
(function (internals) {
@@ -15941,7 +15941,7 @@ var devToolsConfig$jscomp$inline_1792 = {
1594115941
scheduleRoot: null,
1594215942
setRefreshHandler: null,
1594315943
getCurrentFiber: null,
15944-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
15944+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
1594515945
});
1594615946
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;
1594715947
exports.createPortal = function (children, container) {
@@ -16116,7 +16116,7 @@ exports.unstable_flushControlled = function (fn) {
1611616116
}
1611716117
};
1611816118
exports.unstable_runWithPriority = runWithPriority;
16119-
exports.version = "18.3.0-next-78d2e9e2a-20230208";
16119+
exports.version = "18.3.0-next-3ff1540e9-20230209";
1612016120

1612116121
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1612216122
if (

compiled/facebook-www/ReactDOMServer-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-classic-78d2e9e2a-20230208";
22+
var ReactVersion = "18.3.0-www-classic-3ff1540e9-20230209";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");

compiled/facebook-www/ReactDOMServer-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if (__DEV__) {
1919
var React = require("react");
2020
var ReactDOM = require("react-dom");
2121

22-
var ReactVersion = "18.3.0-www-modern-78d2e9e2a-20230208";
22+
var ReactVersion = "18.3.0-www-modern-3ff1540e9-20230209";
2323

2424
// This refers to a WWW module.
2525
var warningWWW = require("warning");

compiled/facebook-www/ReactDOMServer-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3634,4 +3634,4 @@ exports.renderToString = function (children, options) {
36343634
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
36353635
);
36363636
};
3637-
exports.version = "18.3.0-www-classic-78d2e9e2a-20230208";
3637+
exports.version = "18.3.0-www-classic-3ff1540e9-20230209";

compiled/facebook-www/ReactDOMServer-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3548,4 +3548,4 @@ exports.renderToString = function (children, options) {
35483548
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
35493549
);
35503550
};
3551-
exports.version = "18.3.0-www-modern-78d2e9e2a-20230208";
3551+
exports.version = "18.3.0-www-modern-3ff1540e9-20230209";

compiled/facebook-www/ReactDOMTesting-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31212,7 +31212,7 @@ function createFiberRoot(
3121231212
return root;
3121331213
}
3121431214

31215-
var ReactVersion = "18.3.0-www-classic-78d2e9e2a-20230208";
31215+
var ReactVersion = "18.3.0-www-classic-3ff1540e9-20230209";
3121631216

3121731217
function createPortal(
3121831218
children,

compiled/facebook-www/ReactDOMTesting-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38514,7 +38514,7 @@ function createFiberRoot(
3851438514
return root;
3851538515
}
3851638516

38517-
var ReactVersion = "18.3.0-www-modern-78d2e9e2a-20230208";
38517+
var ReactVersion = "18.3.0-www-modern-3ff1540e9-20230209";
3851838518

3851938519
function createPortal(
3852038520
children,

compiled/facebook-www/ReactDOMTesting-prod.classic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11356,7 +11356,7 @@ Internals.Events = [
1135611356
var devToolsConfig$jscomp$inline_1518 = {
1135711357
findFiberByHostInstance: getClosestInstanceFromNode,
1135811358
bundleType: 0,
11359-
version: "18.3.0-www-classic-78d2e9e2a-20230208",
11359+
version: "18.3.0-www-classic-3ff1540e9-20230209",
1136011360
rendererPackageName: "react-dom"
1136111361
};
1136211362
var internals$jscomp$inline_2047 = {
@@ -11386,7 +11386,7 @@ var internals$jscomp$inline_2047 = {
1138611386
scheduleRoot: null,
1138711387
setRefreshHandler: null,
1138811388
getCurrentFiber: null,
11389-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
11389+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
1139011390
};
1139111391
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1139211392
var hook$jscomp$inline_2048 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -14903,4 +14903,4 @@ exports.unstable_renderSubtreeIntoContainer = function (
1490314903
);
1490414904
};
1490514905
exports.unstable_runWithPriority = runWithPriority;
14906-
exports.version = "18.3.0-next-78d2e9e2a-20230208";
14906+
exports.version = "18.3.0-next-3ff1540e9-20230209";

compiled/facebook-www/ReactDOMTesting-prod.modern.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14007,7 +14007,7 @@ Internals.Events = [
1400714007
var devToolsConfig$jscomp$inline_1673 = {
1400814008
findFiberByHostInstance: getClosestInstanceFromNode,
1400914009
bundleType: 0,
14010-
version: "18.3.0-www-modern-78d2e9e2a-20230208",
14010+
version: "18.3.0-www-modern-3ff1540e9-20230209",
1401114011
rendererPackageName: "react-dom"
1401214012
};
1401314013
var internals$jscomp$inline_2072 = {
@@ -14038,7 +14038,7 @@ var internals$jscomp$inline_2072 = {
1403814038
scheduleRoot: null,
1403914039
setRefreshHandler: null,
1404014040
getCurrentFiber: null,
14041-
reconcilerVersion: "18.3.0-next-78d2e9e2a-20230208"
14041+
reconcilerVersion: "18.3.0-next-3ff1540e9-20230209"
1404214042
};
1404314043
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1404414044
var hook$jscomp$inline_2073 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -14369,4 +14369,4 @@ exports.unstable_flushControlled = function (fn) {
1436914369
}
1437014370
};
1437114371
exports.unstable_runWithPriority = runWithPriority;
14372-
exports.version = "18.3.0-next-78d2e9e2a-20230208";
14372+
exports.version = "18.3.0-next-3ff1540e9-20230209";

compiled/facebook-www/ReactTestRenderer-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23911,7 +23911,7 @@ function createFiberRoot(
2391123911
return root;
2391223912
}
2391323913

23914-
var ReactVersion = "18.3.0-www-classic-78d2e9e2a-20230208";
23914+
var ReactVersion = "18.3.0-www-classic-3ff1540e9-20230209";
2391523915

2391623916
// Might add PROFILE later.
2391723917

compiled/facebook-www/ReactTestRenderer-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23911,7 +23911,7 @@ function createFiberRoot(
2391123911
return root;
2391223912
}
2391323913

23914-
var ReactVersion = "18.3.0-www-modern-78d2e9e2a-20230208";
23914+
var ReactVersion = "18.3.0-www-modern-3ff1540e9-20230209";
2391523915

2391623916
// Might add PROFILE later.
2391723917

0 commit comments

Comments
 (0)