Skip to content

Commit

Permalink
Update Suspense fuzz tests to use act (#26498)
Browse files Browse the repository at this point in the history
This updates the Suspense fuzz tester to use `act` to recursively flush
timers instead of doing it manually.

This still isn't great because ideally the fuzz tester wouldn't fake
timers at all. It should resolve promises using a custom queue instead
of Jest's fake timer queue, like we've started doing in our other
Suspense tests (i.e. the `resolveText` pattern). That's because our
internal `act` API (not the public one, the one we use in our tests)
uses Jest's fake timer queue as a way to force Suspense fallbacks to
appear.

However I'm not interested in upgrading this test suite to a better
strategy right now because if I were writing a Suspense fuzzer today I
would probably use an entirely different approach. So this is just an
incremental improvement to make it slightly less decoupled to React
implementation details.

DiffTrain build for commit 1f5cdf8.
  • Loading branch information
acdlite committed Mar 28, 2023
1 parent 0c9b69c commit 18801d3
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23762,7 +23762,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-f62cb39ee-20230328";
var ReactVersion = "18.3.0-next-1f5cdf8c7-20230328";

// Might add PROFILE later.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8640,7 +8640,7 @@ var devToolsConfig$jscomp$inline_1007 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-f62cb39ee-20230328",
version: "18.3.0-next-1f5cdf8c7-20230328",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1198 = {
Expand Down Expand Up @@ -8671,7 +8671,7 @@ var internals$jscomp$inline_1198 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-f62cb39ee-20230328"
reconcilerVersion: "18.3.0-next-1f5cdf8c7-20230328"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1199 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9065,7 +9065,7 @@ var devToolsConfig$jscomp$inline_1050 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-f62cb39ee-20230328",
version: "18.3.0-next-1f5cdf8c7-20230328",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1239 = {
Expand Down Expand Up @@ -9096,7 +9096,7 @@ var internals$jscomp$inline_1239 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-f62cb39ee-20230328"
reconcilerVersion: "18.3.0-next-1f5cdf8c7-20230328"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1240 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-next-f62cb39ee-20230328";
var ReactVersion = "18.3.0-next-1f5cdf8c7-20230328";

// ATTENTION
// When adding new symbols to this file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-f62cb39ee-20230328";
exports.version = "18.3.0-next-1f5cdf8c7-20230328";
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-f62cb39ee-20230328";
exports.version = "18.3.0-next-1f5cdf8c7-20230328";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f62cb39ee58e5918806218de2be8d2833023e7fc
1f5cdf8c77182fc51910787e48384ec4620dc40d
Original file line number Diff line number Diff line change
Expand Up @@ -27028,7 +27028,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-f62cb39ee-20230328";
var ReactVersion = "18.3.0-next-1f5cdf8c7-20230328";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9507,7 +9507,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1027 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-f62cb39ee-20230328",
version: "18.3.0-next-1f5cdf8c7-20230328",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9549,7 +9549,7 @@ var internals$jscomp$inline_1273 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-f62cb39ee-20230328"
reconcilerVersion: "18.3.0-next-1f5cdf8c7-20230328"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1274 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10215,7 +10215,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1106 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-f62cb39ee-20230328",
version: "18.3.0-next-1f5cdf8c7-20230328",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10270,7 +10270,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-f62cb39ee-20230328"
reconcilerVersion: "18.3.0-next-1f5cdf8c7-20230328"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27568,7 +27568,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-next-f62cb39ee-20230328";
var ReactVersion = "18.3.0-next-1f5cdf8c7-20230328";

function createPortal$1(
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9763,7 +9763,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1086 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-f62cb39ee-20230328",
version: "18.3.0-next-1f5cdf8c7-20230328",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -9805,7 +9805,7 @@ var internals$jscomp$inline_1339 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-f62cb39ee-20230328"
reconcilerVersion: "18.3.0-next-1f5cdf8c7-20230328"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1340 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10471,7 +10471,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1165 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-f62cb39ee-20230328",
version: "18.3.0-next-1f5cdf8c7-20230328",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
Expand Down Expand Up @@ -10526,7 +10526,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-f62cb39ee-20230328"
reconcilerVersion: "18.3.0-next-1f5cdf8c7-20230328"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {
Expand Down

0 comments on commit 18801d3

Please sign in to comment.