microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.36k stars 1.14k forks source link

Some JSI Unit Tests Fail #6799

Open JunielKatarn opened 3 years ago

JunielKatarn commented 3 years ago

A small number of the tests imported from the Facebook JSI code base (i.e. node_modules\react-native\ReactCommon\jsi\jsi\test\testlib.cpp) fail deterministically.

Environment

Run the following in your terminal and copy the results here.

yarn
yarn build
cd vnext
nuget restore ReactWindows-Desktop.sln

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Build the test project.
    msbuild .\ReactCommon.UnitTests\
  2. Run the tests.
    vstest.console.exe --TestAdapterPath:"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\ubawx25q.gzi" .\target\x64\Debug\ReactCommon.UnitTests\ReactCommon.UnitTests.exe

Expected Results

All tests pass successfully

Actual Results

The following tests fail:

Workaround

These specific tests are explicitly disabled in CI/PR validations.

ghost commented 3 years ago

Many of our core react-native-windows contributors are taking some much needed vacation throughout December 2020. Thank you for being patient while we relax, recharge, and return to a normal responsiveness in January 2021. In the meantime feel free to continue to pose questions, open issues, and make feature requests - you just may not get a response right away.

NickGerleman commented 3 years ago

FYI @vmoroz since you've been looking at bugs in the Chakra JSI runtime along with @tudorms who has been maintaining v8jsi.

asklar commented 3 years ago

@JunielKatarn do you know whether hermes on windows passes these tests?

JunielKatarn commented 3 years ago

@JunielKatarn do you know whether hermes on windows passes these tests?

I do not, but if enabling Hermes is as simple as enabling Chakra (MSBuild property), it can be verified using the same remaining steps.

jonthysell commented 1 year ago

FYI, these are the tests currently disabled in CI:

#6799 -
            #       HostFunctionTest              - Crashes under JSI/V8
            #       HostObjectProtoTest           - Crashes under JSI/V8
            #       PreparedJavaScriptSourceTest  - Asserts/Fails under JSI/ChakraCore
jonthysell commented 1 year ago

HostObjectProtoTest appears to be passing (using V8) when I run it locally. PreparedJavaScriptSourceTest also appears to be passing, but it may be just for V8 and ChakraCore may still be failing (as per the comments in the CI workflow).

For HostFunctionTest, it appears to be a failure with two unimplemented APIs:

bool V8Runtime::isHostFunction(const jsi::Function &obj) const {
  std::abort();
  return false;
}

jsi::HostFunctionType &V8Runtime::getHostFunction(const jsi::Function &obj) {
  std::abort();
}

@vmoroz I know this bug is old, but is there a reason why these APIs aren't implemented for V8?