Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Regression in v28, open handle from MessageChannel()/scheduler #13144

Closed
bradjones1 opened this issue Aug 17, 2022 · 3 comments
Closed

Comments

@bradjones1
Copy link

bradjones1 commented Aug 17, 2022

Version

28.1.3

Steps to reproduce

I'm not exactly sure what component of my codebase is triggering the handle, but the stacktrace (see below) and other reports seem to indicate this is from scheduler, particularly this line. I will try to isolate an MVP demonstration of code that triggers this.

Downgrading to 27.x seems to fix the problem.

The line in question from scheduler calls new MessageChannel(), and the 28.0 changelog does mention #12553, which could be related?

Expected behavior

Test suite exits with no open handles.

Actual behavior

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  MESSAGEPORT

      3 | import {Appearance, AppState, LogBox, Platform, useColorScheme} from 'react-native';
      4 | import {DarkTheme, DefaultTheme, NavigationContainer, useNavigationContainerRef} from '@react-navigation/native';
    > 5 | import {createNativeStackNavigator} from '@react-navigation/native-stack';
        | ^
      6 | import * as SecureStore from 'expo-secure-store';
      7 | import Orbit from "@orbit/core";
      8 | import {DataProvider} from "react-orbitjs";

      at node_modules/scheduler/cjs/scheduler.development.js:178:17
      at Object.<anonymous> (node_modules/scheduler/cjs/scheduler.development.js:645:5)
      at Object.<anonymous> (node_modules/scheduler/index.js:6:20)
      at require (node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:23:17)
      at Object.<anonymous> (node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js:17:3)
      at Object.require (node_modules/react-native/Libraries/Renderer/shims/ReactNative.js:21:17)
      at Object.require (node_modules/react-native/Libraries/Animated/AnimatedEvent.js:16:21)
      at Object.require (node_modules/react-native/Libraries/Animated/AnimatedMock.js:13:44)
      at Object.require (node_modules/react-native/Libraries/Animated/Animated.js:19:22)
      at Object.require [as Animated] (node_modules/react-native/index.js:260:12)
      at Object.Animated (node_modules/@react-navigation/elements/lib/commonjs/PlatformPressable.tsx:21:27)
      at Object.<anonymous> (node_modules/@react-navigation/elements/lib/commonjs/Header/HeaderBackButton.tsx:14:1)
      at Object.<anonymous> (node_modules/@react-navigation/elements/lib/commonjs/index.tsx:5:1)
      at Object.<anonymous> (node_modules/@react-navigation/native-stack/lib/commonjs/views/NativeStackView.native.tsx:1:1)
      at Object.<anonymous> (node_modules/@react-navigation/native-stack/lib/commonjs/navigators/createNativeStackNavigator.tsx:19:1)
      at Object.<anonymous> (node_modules/@react-navigation/native-stack/lib/commonjs/index.tsx:4:1)
      at Object.<anonymous> (App.tsx:5:1)
      at Object.<anonymous> (__tests__/App.test.tsx:1:1)

Additional context

Similar reports at #12852 (comment), node-fetch/node-fetch#1479 (comment) and callstack/react-native-testing-library#1007 (comment)

Environment

$ npx envinfo --preset jest

  System:
    OS: Linux 5.18 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  Binaries:
    Node: 16.13.1 - /usr/local/bin/node
    Yarn: 1.22.15 - /usr/local/bin/yarn
    npm: 8.1.2 - /usr/local/bin/npm
  npmPackages:
    jest: ^27 => 27.5.1 

(This shows the working version of jest, otherwise this is the same environment.)

@bradjones1
Copy link
Author

Looks like this was supposed to be fixed in React 17.1, but that never landed? facebook/react#20756 (comment)

@SimenB
Copy link
Member

SimenB commented Aug 17, 2022

Yeah, we use react-16-node-hanging-test-fix at work for the RN tests and ignore the (wrong) log message that it's not needed. No idea why React hasn't made that module redundant

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants