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

Flaky tests #9492

Closed
7 tasks done
tony19 opened this issue Aug 1, 2022 · 2 comments · Fixed by #9707
Closed
7 tasks done

Flaky tests #9492

tony19 opened this issue Aug 1, 2022 · 2 comments · Fixed by #9707
Labels

Comments

@tony19
Copy link
Contributor

tony19 commented Aug 1, 2022

Describe the bug

The tests seems to randomly crash when running pnpm test-build or pnpm test-serve on Node 16 with the following errors:

  • Check failed: result.second.

    Run pnpm run test-build
    ⋯
    #
    # Fatal error in , line 0
    # Check failed: result.second.
    #
    #
    #
    #FailureMessage Object: 0x70000c67d4a0
    1: 0x108581412 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    2: 0x109557213 V8_Fatal(char const*, ...) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    3: 0x10896fe7e v8::internal::GlobalBackingStoreRegistry::Register(std::__1::shared_ptr<v8::internal::BackingStore>) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    4: 0x1086a6666 v8::ArrayBuffer::GetBackingStore() [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    5: 0x1084ec4eb node::Buffer::Data(v8::Local<v8::Value>) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    6: 0x10851aefb node::fs::Read(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    7: 0x1086fc939 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    8: 0x1086fc406 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    9: 0x1086fbb7f v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    10: 0x108f6f079 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
    [11](https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#step:13:12): 0x10[17](https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#step:13:18)bc3a85 
    Error: Process completed with exit code 1.
    
  • FATAL ERROR: v8::FromJust Maybe value is Nothing.

    Run pnpm run test-serve
    ⋯
    FATAL ERROR: v8::FromJust Maybe value is Nothing.
    ✓ playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts  (1 test) 1409ms
    1: 00007FF6B7F17C4F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114207
    2: 00007FF6B7EA5EC6 DSA_meth_get_flags+65542
    3: 00007FF6B7EA6D7D node::OnFatalError+301
    4: 00007FF6B87C60D5 v8::V8::FromJustIsNothing+53
    5: 00007FF6B7DC299A v8::internal::wasm::WasmCode::code_comments_offset+22170
    6: 00007FF6B7DC283D v8::internal::wasm::WasmCode::code_comments_offset+21821
    7: 00007FF6B7DBCBC0 v8::internal::HashTable<v8::internal::CompilationCacheTable,v8::internal::CompilationCacheShape>::HashTable<v8::internal::CompilationCacheTable,v8::internal::CompilationCacheShape>+42992
    8: 00007FF6B7F6BC72 uv_pipe_pending_type+4194
    9: 00007FF6B7F767E0 uv_loop_init+1024
    10: 00007FF6B7F76A8A uv_run+202
    11: 00007FF6B7F458F5 node::SpinEventLoop+309
    12: 00007FF6B7DDE520 v8::internal::interpreter::BytecodeLabel::bind+35712
    13: 00007FF6B7DD9B78 v8::internal::interpreter::BytecodeLabel::bind+16856
    14: 00007FF6B7F67[15](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:16)D uv_poll_stop+557
    15: 00007FF6B8D80740 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+1464[16](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:17)
    16: 00007FFD3A594ED0 BaseThreadInitThunk+16
    [17](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:18): 00007FFD3B3BE39B RtlUserThreadStart+43
     ELIFECYCLE  Command failed with exit code 1[34](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:35).
    Error: Process completed with exit code 1.
    

This is an upstream issue in Vitest/Node/V8, but I created an issue here to track any potential workarounds/resolutions for vitejs/vite itself.

Reproduction

https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#logs

The error can be easily reproduced by running pnpm test-build multiple times. For example, run this bash script on Node 16 from the project root of vite:

#!/usr/bin/env bash -e

for i in `seq 20`; do
  echo "************* test run ${i} *************"
  pnpm test-build
done

System Info

Node 16.16.0

Used Package Manager

pnpm

Logs

Build&Test: node-16, macos-latest:

Check failed: result.second.
Run pnpm run test-build

> vite-monorepo@ test-build /Users/runner/work/vite/vite
> cross-env VITE_TEST_BUILD=1 vitest run -c vitest.config.e2e.ts


RUN  v0.1[9](https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#step:13:10).0 /Users/runner/work/vite/vite

✓ playground/hmr/__tests__/hmr.spec.ts  (1 test) 1146ms
✓ playground/vue/__tests__/vue.spec.ts  (34 tests) [10](https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#step:13:11)196ms
✓ playground/ssr-vue/__tests__/ssr-vue.spec.ts  (15 tests | 1 skipped) 9215ms
✓ playground/css/__tests__/css.spec.ts  (33 tests) 4024ms
✓ playground/tailwind/__test__/tailwind.spec.ts  (1 test) 7954ms
✓ playground/vue-jsx/__tests__/vue-jsx.spec.ts  (9 tests | 7 skipped) 4313ms
✓ playground/ssr-react/__tests__/ssr-react.spec.ts  (6 tests) 4743ms
✓ playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts  (1 test) 5653ms
✓ playground/ssr-deps/__tests__/ssr-deps.spec.ts  (15 tests) 3799ms
✓ playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts  (13 tests | 12 skipped) 3927ms
stderr | unknown test
Non-existent export 'Buffer' is imported from __vite-browser-external

✓ playground/optimize-deps/__tests__/optimize-deps.spec.ts  (28 tests | 1 skipped) 7086ms
✓ playground/react-emotion/__tests__/react.spec.ts  (4 tests) 4019ms
✓ playground/css-sourcemap/__tests__/css-sourcemap.spec.ts  (20 tests | 18 skipped) 1799ms
✓ playground/backend-integration/__tests__/backend-integration.spec.ts  (6 tests | 3 skipped) 1915ms
✓ playground/worker/__tests__/relative-base/relative-base-worker.spec.ts  (12 tests) 2490ms


 ELIFECYCLE  Command failed with exit code 1.
#
# Fatal error in , line 0
# Check failed: result.second.
#
#
#
#FailureMessage Object: 0x70000c67d4a0
1: 0x108581412 node::NodePlatform::GetStackTracePrinter()::$_3::__invoke() [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
2: 0x109557213 V8_Fatal(char const*, ...) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
3: 0x10896fe7e v8::internal::GlobalBackingStoreRegistry::Register(std::__1::shared_ptr<v8::internal::BackingStore>) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
4: 0x1086a6666 v8::ArrayBuffer::GetBackingStore() [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
5: 0x1084ec4eb node::Buffer::Data(v8::Local<v8::Value>) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
6: 0x10851aefb node::fs::Read(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
7: 0x1086fc939 v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
8: 0x1086fc406 v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
9: 0x1086fbb7f v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
10: 0x108f6f079 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit [/Users/runner/hostedtoolcache/node/16.16.0/x64/bin/node]
[11](https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#step:13:12): 0x10[17](https://github.com/vitejs/vite/runs/7579105441?check_suite_focus=true#step:13:18)bc3a85 
Error: Process completed with exit code 1.

Build&Test: node-16, windows-latest:

FATAL ERROR: v8::FromJust Maybe value is Nothing.
Run pnpm run test-serve

> vite-monorepo@ test-serve D:\a\vite\vite
> vitest run -c vitest.config.e2e.ts


RUN  v0.20.2 D:/a/vite/vite

✓ playground/assets/__tests__/assets.spec.ts  (46 tests | 7 skipped) 6257ms
✓ playground/hmr/__tests__/hmr.spec.ts  (28 tests) 6671ms
✓ playground/css/__tests__/css.spec.ts  (33 tests | 2 skipped) 5424ms
✓ playground/css-sourcemap/__tests__/css-sourcemap.spec.ts  (20 tests | 2 skipped) 2373ms
✓ playground/vue/__tests__/vue.spec.ts  (34 tests) 614[9](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:10)ms
✓ playground/ssr-vue/__tests__/ssr-vue.spec.ts  (15 tests | 1 skipped) 8341ms
✓ playground/html/__tests__/html.spec.ts  (44 tests | 7 skipped) 2391ms
✓ playground/assets/__tests__/relative-base/relative-base-assets.spec.ts  (33 tests | 2 skipped) 1616ms
✓ playground/assets/__tests__/runtime-base/runtime-base-assets.spec.ts  (33 tests | 2 skipped) 1735ms
✓ playground/optimize-deps/__tests__/optimize-deps.spec.ts  (28 tests) 3094ms
↓ playground/worker/__tests__/sourcemap/sourcemap-worker.spec.ts  (1 test | 1 skipped)
↓ playground/worker/__tests__/sourcemap-hidden/sourcemap-hidden-worker.spec.ts  (1 test | 1 skipped)
✓ playground/vue-jsx/__tests__/vue-jsx.spec.ts  (9 tests) 3976ms
✓ playground/worker/__tests__/relative-base/relative-base-worker.spec.ts  (12 tests | 4 skipped) 2566ms
✓ playground/worker/__tests__/es/es-worker.spec.ts  (13 tests | 2 skipped) 2223ms
✓ playground/resolve/__tests__/resolve.spec.ts  (28 tests) 2465ms
↓ playground/worker/__tests__/sourcemap-inline/sourcemap-inline-worker.spec.ts  (1 test | 1 skipped)
✓ playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts  (13 tests | 1 skipped) 2732ms
✓ playground/glob-import/__tests__/glob-import.spec.ts  (6 tests) 1978ms
✓ playground/fs-serve/__tests__/fs-serve.spec.ts  (17 tests) 1134ms
✓ playground/legacy/__tests__/legacy.spec.ts  (11 tests | 4 skipped) 979ms
✓ playground/worker/__tests__/iife/iife-worker.spec.ts  (11 tests | 2 skipped) 2198ms
✓ playground/dynamic-import/__tests__/dynamic-import.spec.ts  (14 tests) 1673ms
✓ playground/ssr-deps/__tests__/ssr-deps.spec.ts  (15 tests) 4[10](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:11)0ms
✓ playground/tsconfig-json/__tests__/tsconfig-json.spec.ts  (4 tests) 660ms
✓ playground/backend-integration/__tests__/backend-integration.spec.ts  (6 tests | 1 skipped) 2109ms
↓ playground/resolve-config/__tests__/resolve-config.spec.ts  (12 tests | 12 skipped)
✓ playground/tailwind/__test__/tailwind.spec.ts  (4 tests) 6125ms
✓ playground/tsconfig-json-load-error/__tests__/tsconfig-json-load-error.spec.ts  (5 tests | 2 skipped) 921ms
✓ playground/ssr-react/__tests__/ssr-react.spec.ts  (6 tests) 5055ms
✓ playground/lib/__tests__/lib.spec.ts  (7 tests | 6 skipped) 687ms
✓ playground/define/__tests__/define.spec.ts  (1 test) [11](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:12)48ms
✓ playground/env/__tests__/env.spec.ts  ([12](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:13) tests) 894ms
✓ playground/css/postcss-caching/css.spec.ts  (1 test) 1226ms
✓ playground/js-sourcemap/__tests__/js-sourcemap.spec.ts  (4 tests | 1 skipped) 635ms
✓ playground/alias/__tests__/alias.spec.ts  (9 tests) 1239ms
✓ playground/react-emotion/__tests__/react.spec.ts  (4 tests) 3165ms
✓ playground/json/__tests__/json.spec.ts  (9 tests) 830ms
↓ playground/file-delete-restore/__tests__/file-delete-restore.spec.ts  (1 test | 1 skipped) 1ms
✓ playground/css-codesplit/__tests__/css-codesplit.spec.ts  (5 tests | 2 skipped) 872ms
✓ playground/react/__tests__/react.spec.ts  (4 tests) 2503ms
✓ playground/react-classic/__tests__/react.spec.ts  (4 tests) 2036ms
✓ playground/ssr-html/__tests__/ssr-html.spec.ts  (2 tests) 1101ms
✓ playground/ssr-pug/__tests__/ssr-pug.spec.ts  (2 tests) [13](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:14)62ms
✓ playground/css/__tests__/postcss-plugins-different-dir/postcss-plugins-different-dir.spec.ts  (1 test) 5168ms
✓ playground/wasm/__tests__/wasm.spec.ts  (5 tests) 1001ms
✓ playground/vue-lib/__tests__/vue-lib.spec.ts  (1 test) 2265ms
✓ playground/cli-module/__tests__/cli-module.spec.ts  (1 test) [14](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:15)94ms
✓ playground/preload/__tests__/preload.spec.ts  (3 tests | 2 skipped) 1248ms
✓ playground/css-codesplit-cjs/__tests__/css-codesplit.spec.ts  (3 tests | 2 skipped) 694ms
↓ playground/minify/__tests__/minify.spec.ts  (1 test | 1 skipped)
✓ playground/cli/__tests__/cli.spec.ts  (1 test) 1497ms
✓ playground/nested-deps/__tests__/nested-deps.spec.ts  (1 test) 1037ms
✓ playground/optimize-missing-deps/__test__/optimize-missing-deps.spec.ts  (1 test) 1132ms
↓ playground/external/__tests__/external.spec.ts  (2 tests | 2 skipped)
stdout | playground/ssr-webworker/__tests__/ssr-webworker.spec.ts > /
foo

✓ playground/ssr-webworker/__tests__/ssr-webworker.spec.ts  (2 tests | 1 skipped) 2705ms
↓ playground/legacy/__tests__/ssr/legacy-ssr.spec.ts  (2 tests | 2 skipped)
✓ playground/tailwind-sourcemap/__tests__/tailwind-sourcemap.spec.ts  (2 tests | 1 skipped) 1266ms
✓ playground/env-nested/__tests__/env-nested.spec.ts  (3 tests) 725ms
✓ playground/data-uri/__tests__/data-uri.spec.ts  (3 tests | 1 skipped) 623ms
FATAL ERROR: v8::FromJust Maybe value is Nothing.
✓ playground/multiple-entrypoints/__tests__/multiple-entrypoints.spec.ts  (1 test) 1409ms
1: 00007FF6B7F17C4F v8::internal::CodeObjectRegistry::~CodeObjectRegistry+114207
2: 00007FF6B7EA5EC6 DSA_meth_get_flags+65542
3: 00007FF6B7EA6D7D node::OnFatalError+301
4: 00007FF6B87C60D5 v8::V8::FromJustIsNothing+53
5: 00007FF6B7DC299A v8::internal::wasm::WasmCode::code_comments_offset+22170
6: 00007FF6B7DC283D v8::internal::wasm::WasmCode::code_comments_offset+21821
7: 00007FF6B7DBCBC0 v8::internal::HashTable<v8::internal::CompilationCacheTable,v8::internal::CompilationCacheShape>::HashTable<v8::internal::CompilationCacheTable,v8::internal::CompilationCacheShape>+42992
8: 00007FF6B7F6BC72 uv_pipe_pending_type+4194
9: 00007FF6B7F767E0 uv_loop_init+1024
10: 00007FF6B7F76A8A uv_run+202
11: 00007FF6B7F458F5 node::SpinEventLoop+309
12: 00007FF6B7DDE520 v8::internal::interpreter::BytecodeLabel::bind+35712
13: 00007FF6B7DD9B78 v8::internal::interpreter::BytecodeLabel::bind+16856
14: 00007FF6B7F67[15](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:16)D uv_poll_stop+557
15: 00007FF6B8D80740 v8::internal::compiler::RepresentationChanger::Uint32OverflowOperatorFor+1464[16](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:17)
16: 00007FFD3A594ED0 BaseThreadInitThunk+16
[17](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:18): 00007FFD3B3BE39B RtlUserThreadStart+43
 ELIFECYCLE  Command failed with exit code 1[34](https://github.com/vitejs/vite/runs/7617980968?check_suite_focus=true#step:12:35).
Error: Process completed with exit code 1.

Validations

@bluwy
Copy link
Member

bluwy commented Aug 2, 2022

I'm getting the FATAL ERROR: v8::FromJust Maybe value is Nothing. error often locally on macos. I'm not sure how this can be fixed here though, perhaps some sort of "auto-retry CI when matched FATAL ERROR: v8::FromJust Maybe value is Nothing." heuristic?

@bluwy bluwy added test and removed pending triage labels Aug 2, 2022
@tony19
Copy link
Contributor Author

tony19 commented Aug 2, 2022

@bluwy Yeah, I noticed that myself. I can easily reproduce Check failed: result.second. multiple times locally just by running pnpm test-build 20 times in a row via script with Node 16. I agree an automated retry is probably the path forward for now, especially since the fix from Node 18 can't be feasibly backported. I'm actually experimenting on that right now.

@tony19 tony19 mentioned this issue Aug 3, 2022
9 tasks
@bluwy bluwy linked a pull request Aug 9, 2022 that will close this issue
9 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants