question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flaky `Engine is not yet connected.` CI test with Node-API

See original GitHub issue

Bug description

This test is flaky with Node-API

FAIL src/__tests__/integration/happy/disconnect-while-query/test.ts
  ✕ disconnect-while-query (770 ms)
  ● disconnect-while-query
    Invalid `prisma.user.findMany()` invocation in
    /home/runner/work/prisma/prisma/src/packages/client/src/__tests__/integration/happy/disconnect-while-query/test.ts:8:25
       5 const prisma = new PrismaClient()
       6 
       7 await prisma.user.findMany()
    →  8 const a = prisma.user.findMany(
      Engine is not yet connected.
       0: user_facing_errors::Error::new_non_panic_with_current_backtrace
       1: query_engine_napi::error::<impl core::convert::From<query_engine_napi::error::ApiError> for user_facing_errors::Error>::from
       2: query_engine_napi::error::<impl core::convert::From<query_engine_napi::error::ApiError> for napi::error::Error>::from
       3: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
       4: tokio::runtime::task::core::CoreStage<T>::poll
       5: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
       6: tokio::runtime::task::harness::poll_future
       7: tokio::runtime::task::harness::Harness<T,S>::poll
       8: std::thread::local::LocalKey<T>::with
       9: tokio::runtime::thread_pool::worker::Context::run_task
      10: tokio::runtime::thread_pool::worker::Context::run
      11: tokio::macros::scoped_tls::ScopedKey<T>::set
      12: tokio::runtime::thread_pool::worker::run
      13: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
      14: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
      15: tokio::runtime::task::harness::Harness<T,S>::poll
      16: tokio::runtime::blocking::pool::Inner::run
      17: std::sys_common::backtrace::__rust_begin_short_backtrace
      18: core::ops::function::FnOnce::call_once{{vtable.shim}}
      19: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
      at ../../../../../../../../rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/alloc/src/boxed.rs:1521:9
            <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
      at ../../../../../../../../rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/alloc/src/boxed.rs:1521:9
            std::sys::unix::thread::Thread::new::thread_start
      at ../../../../../../../../rustc/2fd73fabe469357a12c2c974c140f67e7cdd76d0/library/std/src/sys/unix/thread.rs:71:17
        20: start_thread
        21: clone
      at cb (src/runtime/PrismaClientFetcher.ts:172:17)

In Github Actions: https://github.com/prisma/prisma/pull/7566/checks?check_run_id=2783712904#step:8:1202

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

Flaky tests - GitLab Docs
Example 3: A test for a database query passes in a fresh database, but in a CI/CD pipeline where the database is used...
Read more >
How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >
JUnit 5 User Guide
However, you can still test code that has been compiled with ... Unlike JUnit 4's @Test annotation, this annotation does not declare any ......
Read more >
Launching Browsers | Cypress Documentation
Because Electron is the default browser - it is typically run in CI. If you are seeing failures in CI, to easily debug...
Read more >
7 Github Actions Tricks I Wish I Knew Before I Started
Now imagine you need to setup a massive CI/CD workflow. ... You might not yet be confident enough in the process to deploy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found