-
Notifications
You must be signed in to change notification settings - Fork 237
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
Fix panic kills running engine in query-engine-tests #4499
Fix panic kills running engine in query-engine-tests #4499
Conversation
c6d1792
to
3c736f1
Compare
CodSpeed Performance ReportMerging #4499 will not alter performanceComparing Summary
|
1584922
to
9dad3a9
Compare
This includes rustwasm/wasm-bindgen#3203 that use queueMicrotask to transalate spawn_local rust code. This has fixed rustwasm/wasm-bindgen#2392 which was an issue about not being able to catch async wasm traps. This might (or not) have an effect on the issue we are trying to solve in here.
This reverts commit 9a494dc.
9dad3a9
to
da69268
Compare
There a many unrelated test failures after having rebased #4466 However Runs all the interactive_tx tests rather than failing on the first. See output: |
exit_with_message(1, "child node process stdout closed") | ||
tracing::error!("Error when reading from child node process. Process might have exited. Restarting..."); | ||
if let Some((_, sender)) = last_pending_request.take() { | ||
let _ = sender.send(Err(Box::new(jsonrpc_core::types::Error::new(jsonrpc_core::ErrorCode::ServerError(500))))).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might need to adjust this, Given the last few lines of the test report
output.txt
params=[] result="success" item_type="query" is_query=true duration_ms=8
thread 'new::interactive_tx::itx_isolation::spacing_doesnt_matter' panicked at query-engine/connector-test-kit-rs/query-tests-setup/src/lib.rs:290:35:
called `Result::unwrap()` on an `Err` value: External(Error { code: ServerError(500), message: "Server error", data: None })
failures:
new::interactive_tx::interactive_tx::basic_commit_workflow
new::interactive_tx::interactive_tx::basic_rollback_workflow
new::interactive_tx::interactive_tx::batch_queries_failure
new::interactive_tx::interactive_tx::batch_queries_rollback
new::interactive_tx::interactive_tx::batch_queries_success
new::interactive_tx::interactive_tx::commit_after_rollback
new::interactive_tx::interactive_tx::double_commit
new::interactive_tx::interactive_tx::double_rollback
new::interactive_tx::interactive_tx::multiple_tx
new::interactive_tx::interactive_tx::no_auto_rollback
new::interactive_tx::interactive_tx::raw_queries
new::interactive_tx::interactive_tx::rollback_after_commit
new::interactive_tx::interactive_tx::tx_expiration_cycle
new::interactive_tx::interactive_tx::tx_expiration_failure_cycle
new::interactive_tx::interactive_tx::write_conflict
new::interactive_tx::itx_isolation::basic_serializable
new::interactive_tx::itx_isolation::casing_doesnt_matter
new::interactive_tx::itx_isolation::invalid_isolation
new::interactive_tx::itx_isolation::spacing_doesnt_matter
test result: FAILED. 1 passed; 19 failed; 0 ignored; 0 measured; 1563 filtered out; finished in 4.18s
error: test failed, to rerun pass `-p query-engine-tests --test query_engine_tests
query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/js/external_process.rs
Outdated
Show resolved
Hide resolved
query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/js/external_process.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving with a few non-blocking questions/suggestions
Oh, one more thing, could we remove |
After playing with it a little bit, it does not seem like we see output/backtrace of a panic anymore. Is there a quick way in which we could preserve it? |
Working on your feedback, will request review again when done. |
I'm not sure I can reproduce:
leads to test_run.txt, which has the when the tests run (rather than being reported at the end)
|
bbee355
to
22042e1
Compare
a3a9ae8
to
ff1b78c
Compare
715c87f
into
feat/query-engine-wasm32-unknown-unknown
* feat(quaint): allow wasm32-unknown-unknown compilation; currently fails on native * feat(quaint): split postgres connector into native and wasm submodules * feat(quaint): split mysql connector into native and wasm submodules * feat(quaint): recover wasm error for mysql * feat(quaint): split mssql connector into native and wasm submodules * feat(quaint): split sqlite connector into native and wasm submodules * chore(quaint): fix clippy when compiling natively * chore(quaint): fix clippy when compiling to wasm32-unknown-unknown * chore(quaint): update README * chore(quaint): rename "*-connector" feature flag to "*-native" * feat(quaint): enable pure Wasm SqliteError * feat(query-connect): allow wasm32-unknown-unknown compilation * feat(sql-query-connector): allow wasm32-unknown-unknown compilation * chore(query-engine-wasm): add currently unused local crates to test wasm32-unknown-unknown compilation * chore: update Cargo.lock * chore: remove leftover comments * feat(query-core): allow wasm32-unknown-unknown compilation * chore(sql-query-connector): fix clipppy on wasm32 * chore: remove leftover comment * chore: remove leftover comment * feat(driver-adapters): enable Wasm on request-handlers * WIP: refactor mysql module to flatten its structure * feat(quaint): flatten mssql connector module * feat(quaint): flatten postgres connector module * feat(quaint): flatten sqlite connector module * chore(quaint): export all public definitions in connector "url" modules * chore(quaint): refactor tests for connectors, addressing feedback * chore: add comment on MysqlAsyncError * chore: add comment on ffi.rs for sqlite * chore: replace awkward "super::super::" with "crate::..." * chore: add comments around "query_core::executor::task" * chore: add comments around "query_core::executor::task" * chore: add "request-handlers" to "query-engine-wasm" * chore: add wasm dependencies to Cargo workspace * feat(driver-adapters): move napi-specific code into "napi" module, prepare empty "wasm" module * feat(driver-adapters): extracted platform-agnostic "DriverAdapterError" into "driver_adapters::error" * chore(driver-adapters): add "driver-adapters" to "query-engine-wasm" * feat(driver-adapters): add Wasm-specific "async_js_function" * feat(driver-adapters): extracted common types to "driver_adapters::types" * feat(driver-adapters): extracted "TryFrom<JSResultSet> for QuaintResultSet" to "driver_adapters::conversion::js_to_quaint" * feat(driver-adapters): allow feature-complete Wasm compilation of "driver-adapters" * feat(driver-adapters): plug "driver-adapters" to "query-engine-wasm" * chore: remove .cargo, add it to .gitignore * chore: move "task" module into its own file * fix(driver-adapters): ci for "request-handlers" * fix(driver-adapters): ci for "request-handlers" * fix(driver-adapters): clippy compile error on "query-engine-wasm" * chore(driver-adapters): fix conflicting library name warning on "cargo build" * chore: fix conflicts * chore: fixed some clippy warnings * chore: add .cargo to .gitignore * feat(query-engine-wasm): ported some logic from query-engine-node-api in a wasm32-compatible fashion * Add connect/disconnect * fix: remove tokio-induced panic in "connect" * feat: remove ducktor * feat(driver-adapters): remove "queryable" into its own module * Couple of fixes 1. Build schema and connect sequentually 2. Print full stacktrace for WASM error 3. Expand example to attempt a query * Fix `Instant::now` usage Replace `Instant::now` with a custom library, that will use appriate time/date functions for the platforms. For native, it is `std::time`, for WASM in should probably be `performance::now()` but it is a no-op stub for now. * fix(driver-adapters): understand "flavour" and adjust casing in "JSResultSet" * feat(driver-adapters): add some Into traits for "JsResult" * Fix JSResult parsing * Reorganize example Switch to sqlite so cloud services are not required Save schema to external file * Fix some of the warnings * Remove unused file * Fix WASM transaction binding Correctly gets to a point of starting the tranasction and executing the query, fails on parsing the results like normal queries do. * Cleanup * feat(driver-adapters): fix enum parsing, add "wasm-rs-dbg" crate for dev development * chore(driver-adapters): remove unused "src/wasm/queryable.rs" * chore(driver-adapters): add "createOne" and "driverAdapters" preview feature to example * chore(driver-adapters): add wasm-bindgen-test example * chore(driver-adapters): update Cargo.lock * Handle non-promise return values * Run tests on WASM * feat(core): allow Drop'ing futures running in loop in wasm32-* via controlled spawns * feat(chore): add Arc<DriverAdapter> comment * feat(chore): re-enable previous "disconnect()" * feat(chore): update example.js * fix(query-engine-node-api): fix compilation errors * Update cuid * Remove one more isntant usage * chore(driver-adapters): simplify async_js_function API * chore(driver-adapters): unify napi/wasm errors into "crate::JsResult" * chore(driver-adapters): continue unifying napi/wasm functions * chore(driver-adapters): unify napi/wasm logic for proxy * chore(driver-adapters): unify napi/wasm logic queryable.rs and proxy.rs * chore(driver-adapters): unify napi/wasm logic for transaction.rs * chore(driver-adapters): clippy fixes * chore(driver-adapters): cli ppy fixes * chore: remove dbg! output * chore: remove dbg! output * Fix itx panic * Remove unused import * Fix hanging itx * fix insta tests Strictly speaking, not related to wasm engine at all - we bumped `insta` at some point and that required adding `allow_duplicates` macro around the loop. Close prisma/team-orm#651 * feat(query-engine-wasm): enable tracing and bits of telemetry * chore: clippy * Fix panic kills running engine in query-engine-tests (#4499) * I didn't have wasm-pack installed, let's fix that * Update wasm-bindgen-futures to 0.4.39 This includes rustwasm/wasm-bindgen#3203 that use queueMicrotask to transalate spawn_local rust code. This has fixed rustwasm/wasm-bindgen#2392 which was an issue about not being able to catch async wasm traps. This might (or not) have an effect on the issue we are trying to solve in here. * Revert "Update wasm-bindgen-futures to 0.4.39" This reverts commit 9a494dc. * Restart executor when it dies * Document Restartable * Remove async_panic_to_js_error in WASM query engine * Rename p -> process * Use tokio::sync::RwLock rather than futures::lock::Mutex * Better error messaging * Fixing clippy * Exclude unit tests for wasm32 when compiling the binary for other architectures * Fix duplicate snapshots in json_filters test * Size low hanging fruits Removes following functionality from WASM engine: - GraphQL protocol - DMMF - SDL Schema Neither of the features are used by the client runtimes and thrid party clients don't and can not use WASM engine, so it is safe to remove. * feat(driver-adapters): serialize empty values as "null" rather than "undefined" * chore: fixed query-engine-node-api build * chore: bumped wasm-bindgen version to 0.2.89 * chore: clean up quaint transitive dependencies * chore: removed wasm.rs test * chore: removed temporary wasm machinery * chore: fix clippy * chore: remove unwrap from "sleep" * chore: revert unnecessary psl change * chore(driver-adapters): fix unit tests * chore(driver-adapters): add clippy check for wasm32 * chore(driver-adapters): add clippy check for wasm32 * chore: fix clippy * Revert "chore: removed wasm.rs test" This reverts commit 60b0d8c. * test(driver-adapters): add byte tests for conversion * Revert "Revert "chore: removed wasm.rs test"" This reverts commit 481ba65. * [skip ci] chore: fix build CI check logic * Revert "[skip ci] chore: fix build CI check logic" This reverts commit 28c6ff9. * Stop using removed method * Fix broken JS * chore(review): rename threadsafe_fn to fn_ * chore(review): add comment related to js_sys::Reflect in JsObjectExtern * chore(review): rename SendFuture to UnsafeFuture, improving comments * chore(review): use fully-specialized types for wasm/napi-specific logic, when possible; apply clippy fixes * chore(review): rename JsResult into AdapterResult, reduce duplication, improve comments * chore(review): remove redudant full type qualifier * chore(review): revert changes to psl-core * chore(review): improve comments on js.rs * Test fixes for NAPI tests (#4515) * chore(review): comment on spawn_controlled actors, add error tracing to unexpected case * chore(review): remove unused dependency * chore(review): move wasm/napi-specific task JoinHandle stuff to crosstarget-utils * qe-wasm: Partially fix tests (#4517) * qe-wasm: Partially fix the test suite 1. Bash script for build did not abort on error, hence sed error on linux went unnoticed. 2. We don't actually need sed trickery sincce `wasm-pack` has a flag for changing binary name. 3. `tracing` feature does not actually work on WASM even partially: it panics on `Instant` invokation as soon as first span is created. Since we are running tests with all preview features enabled, that means that practically any test panics now. Disabled it again. A lot of tests are still failing on ThreadRng invocation and stacktrace is not really helpful, but I still think it's better if we get it working. * Update query-engine/query-engine-wasm/build.sh * qe-wasm: Fix RNG on Node 18 in a test runner (#4526) * qe: Skipping failing tests on WASM (#4527) * Add a way to skip WASM tests * Temproary skip failing wasm tests on pg and neon * Skip timstamp test * Fix incorrect skips * Parse libsql.js.wasm version * Skip libsql wasm tests * Fix vitess version parsing * Skip wasm planetscale tests that are also skipped for napi * Rename jobs * Skip planetscale wasm tests * Fix some incorrect skips * And more fixes * Be careful when copy-pasting, please * One more fix * Fix null lists * Again: be careful when copy-pasting * Skip timestamp test on libsql and planetscale * Update .github/workflows/test-query-engine-driver-adapters.yml Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> --------- Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com> --------- Co-authored-by: Miguel Fernandez <miguel@mff.io> Co-authored-by: Sergey Tatarintsev <tatarintsev@prisma.io> Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> Co-authored-by: Miguel Fernández <fernandez@prisma.io> Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
…ne-node-api` and `query-engine-wasm` (#4521) * feat(quaint): allow wasm32-unknown-unknown compilation; currently fails on native * feat(quaint): split postgres connector into native and wasm submodules * feat(quaint): split mysql connector into native and wasm submodules * feat(quaint): recover wasm error for mysql * feat(quaint): split mssql connector into native and wasm submodules * feat(quaint): split sqlite connector into native and wasm submodules * chore(quaint): fix clippy when compiling natively * chore(quaint): fix clippy when compiling to wasm32-unknown-unknown * chore(quaint): update README * chore(quaint): rename "*-connector" feature flag to "*-native" * feat(quaint): enable pure Wasm SqliteError * feat(query-connect): allow wasm32-unknown-unknown compilation * feat(sql-query-connector): allow wasm32-unknown-unknown compilation * chore(query-engine-wasm): add currently unused local crates to test wasm32-unknown-unknown compilation * chore: update Cargo.lock * chore: remove leftover comments * feat(query-core): allow wasm32-unknown-unknown compilation * chore(sql-query-connector): fix clipppy on wasm32 * chore: remove leftover comment * chore: remove leftover comment * feat(driver-adapters): enable Wasm on request-handlers * WIP: refactor mysql module to flatten its structure * feat(quaint): flatten mssql connector module * feat(quaint): flatten postgres connector module * feat(quaint): flatten sqlite connector module * chore(quaint): export all public definitions in connector "url" modules * chore(quaint): refactor tests for connectors, addressing feedback * chore: add comment on MysqlAsyncError * chore: add comment on ffi.rs for sqlite * chore: replace awkward "super::super::" with "crate::..." * chore: add comments around "query_core::executor::task" * chore: add comments around "query_core::executor::task" * chore: add "request-handlers" to "query-engine-wasm" * chore: add wasm dependencies to Cargo workspace * feat(driver-adapters): move napi-specific code into "napi" module, prepare empty "wasm" module * feat(driver-adapters): extracted platform-agnostic "DriverAdapterError" into "driver_adapters::error" * chore(driver-adapters): add "driver-adapters" to "query-engine-wasm" * feat(driver-adapters): add Wasm-specific "async_js_function" * feat(driver-adapters): extracted common types to "driver_adapters::types" * feat(driver-adapters): extracted "TryFrom<JSResultSet> for QuaintResultSet" to "driver_adapters::conversion::js_to_quaint" * feat(driver-adapters): allow feature-complete Wasm compilation of "driver-adapters" * feat(driver-adapters): plug "driver-adapters" to "query-engine-wasm" * chore: remove .cargo, add it to .gitignore * chore: move "task" module into its own file * fix(driver-adapters): ci for "request-handlers" * fix(driver-adapters): ci for "request-handlers" * fix(driver-adapters): clippy compile error on "query-engine-wasm" * chore(driver-adapters): fix conflicting library name warning on "cargo build" * chore: fix conflicts * chore: fixed some clippy warnings * chore: add .cargo to .gitignore * feat(query-engine-wasm): ported some logic from query-engine-node-api in a wasm32-compatible fashion * Add connect/disconnect * fix: remove tokio-induced panic in "connect" * feat: remove ducktor * feat(driver-adapters): remove "queryable" into its own module * Couple of fixes 1. Build schema and connect sequentually 2. Print full stacktrace for WASM error 3. Expand example to attempt a query * Fix `Instant::now` usage Replace `Instant::now` with a custom library, that will use appriate time/date functions for the platforms. For native, it is `std::time`, for WASM in should probably be `performance::now()` but it is a no-op stub for now. * fix(driver-adapters): understand "flavour" and adjust casing in "JSResultSet" * feat(driver-adapters): add some Into traits for "JsResult" * Fix JSResult parsing * Reorganize example Switch to sqlite so cloud services are not required Save schema to external file * Fix some of the warnings * Remove unused file * Fix WASM transaction binding Correctly gets to a point of starting the tranasction and executing the query, fails on parsing the results like normal queries do. * Cleanup * feat(driver-adapters): fix enum parsing, add "wasm-rs-dbg" crate for dev development * chore(driver-adapters): remove unused "src/wasm/queryable.rs" * chore(driver-adapters): add "createOne" and "driverAdapters" preview feature to example * chore(driver-adapters): add wasm-bindgen-test example * chore(driver-adapters): update Cargo.lock * Handle non-promise return values * Run tests on WASM * feat(core): allow Drop'ing futures running in loop in wasm32-* via controlled spawns * feat(chore): add Arc<DriverAdapter> comment * feat(chore): re-enable previous "disconnect()" * feat(chore): update example.js * fix(query-engine-node-api): fix compilation errors * Update cuid * Remove one more isntant usage * chore(driver-adapters): simplify async_js_function API * chore(driver-adapters): unify napi/wasm errors into "crate::JsResult" * chore(driver-adapters): continue unifying napi/wasm functions * chore(driver-adapters): unify napi/wasm logic for proxy * chore(driver-adapters): unify napi/wasm logic queryable.rs and proxy.rs * chore(driver-adapters): unify napi/wasm logic for transaction.rs * chore(driver-adapters): clippy fixes * chore(driver-adapters): cli ppy fixes * chore: remove dbg! output * chore: remove dbg! output * Fix itx panic * Remove unused import * Fix hanging itx * fix insta tests Strictly speaking, not related to wasm engine at all - we bumped `insta` at some point and that required adding `allow_duplicates` macro around the loop. Close prisma/team-orm#651 * feat(query-engine-wasm): enable tracing and bits of telemetry * chore: clippy * Fix panic kills running engine in query-engine-tests (#4499) * I didn't have wasm-pack installed, let's fix that * Update wasm-bindgen-futures to 0.4.39 This includes rustwasm/wasm-bindgen#3203 that use queueMicrotask to transalate spawn_local rust code. This has fixed rustwasm/wasm-bindgen#2392 which was an issue about not being able to catch async wasm traps. This might (or not) have an effect on the issue we are trying to solve in here. * Revert "Update wasm-bindgen-futures to 0.4.39" This reverts commit 9a494dc. * Restart executor when it dies * Document Restartable * Remove async_panic_to_js_error in WASM query engine * Rename p -> process * Use tokio::sync::RwLock rather than futures::lock::Mutex * Better error messaging * Fixing clippy * Exclude unit tests for wasm32 when compiling the binary for other architectures * Fix duplicate snapshots in json_filters test * Size low hanging fruits Removes following functionality from WASM engine: - GraphQL protocol - DMMF - SDL Schema Neither of the features are used by the client runtimes and thrid party clients don't and can not use WASM engine, so it is safe to remove. * feat(driver-adapters): serialize empty values as "null" rather than "undefined" * chore: fixed query-engine-node-api build * chore: bumped wasm-bindgen version to 0.2.89 * chore: clean up quaint transitive dependencies * chore: removed wasm.rs test * chore: removed temporary wasm machinery * chore: fix clippy * chore: remove unwrap from "sleep" * chore: revert unnecessary psl change * chore(driver-adapters): fix unit tests * chore(driver-adapters): add clippy check for wasm32 * chore(driver-adapters): add clippy check for wasm32 * chore: fix clippy * Revert "chore: removed wasm.rs test" This reverts commit 60b0d8c. * test(driver-adapters): add byte tests for conversion * Revert "Revert "chore: removed wasm.rs test"" This reverts commit 481ba65. * [skip ci] chore: fix build CI check logic * Revert "[skip ci] chore: fix build CI check logic" This reverts commit 28c6ff9. * Stop using removed method * Fix broken JS * chore(review): rename threadsafe_fn to fn_ * chore(review): add comment related to js_sys::Reflect in JsObjectExtern * chore(review): rename SendFuture to UnsafeFuture, improving comments * chore(review): use fully-specialized types for wasm/napi-specific logic, when possible; apply clippy fixes * chore(review): rename JsResult into AdapterResult, reduce duplication, improve comments * chore(review): remove redudant full type qualifier * chore(review): revert changes to psl-core * chore(review): improve comments on js.rs * Test fixes for NAPI tests (#4515) * chore(review): comment on spawn_controlled actors, add error tracing to unexpected case * chore(review): remove unused dependency * chore(review): move wasm/napi-specific task JoinHandle stuff to crosstarget-utils * feat(query-engine-common): reduce duplicated code between "query-engine-wasm" and "query-engine-node-api" * qe-wasm: Partially fix tests (#4517) * qe-wasm: Partially fix the test suite 1. Bash script for build did not abort on error, hence sed error on linux went unnoticed. 2. We don't actually need sed trickery sincce `wasm-pack` has a flag for changing binary name. 3. `tracing` feature does not actually work on WASM even partially: it panics on `Instant` invokation as soon as first span is created. Since we are running tests with all preview features enabled, that means that practically any test panics now. Disabled it again. A lot of tests are still failing on ThreadRng invocation and stacktrace is not really helpful, but I still think it's better if we get it working. * Update query-engine/query-engine-wasm/build.sh * qe-wasm: Fix RNG on Node 18 in a test runner (#4526) * feat(query-engine-common): move more stuff to "query-engine-common" * feat: limit the number of conditional flags for each native-only struct field by introducing *Native structs conditionally * feat: remove unused code (supersedes #4524) --------- Co-authored-by: Miguel Fernandez <miguel@mff.io> Co-authored-by: Sergey Tatarintsev <tatarintsev@prisma.io> Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com> Co-authored-by: Miguel Fernández <fernandez@prisma.io>
This PR allows to continue running the tests after the node process has aborted due to a panic, rather than exiting.
Closes: https://github.com/prisma/team-orm/issues/633