prisma: Flaky `Engine is not yet connected.` CI test with Node-API
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
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 21 (11 by maintainers)
For my case the problem happened after I did
But got fixed after I did
I found that new flaky tests have been detected around this (via
disconnect-while-query
test) https://buildpulse.io/@prisma/prisma/tests/2892009034Here is another one: https://github.com/prisma/prisma/runs/4409393821?check_suite_focus=true#step:9:1167
Which one of those is triggered in these tests?