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

Fix panic kills running engine in query-engine-tests #4499

Merged
merged 11 commits into from
Nov 29, 2023

Conversation

miguelff
Copy link
Contributor

@miguelff miguelff commented Nov 27, 2023

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

@miguelff miguelff changed the base branch from main to feat/query-engine-wasm32-unknown-unknown November 27, 2023 15:45
Copy link

codspeed-hq bot commented Nov 27, 2023

CodSpeed Performance Report

Merging #4499 will not alter performance

Comparing mff/633-panics (ff1b78c) with feat/query-engine-wasm32-unknown-unknown (269998d)

Summary

✅ 11 untouched benchmarks

@miguelff miguelff force-pushed the mff/633-panics branch 2 times, most recently from 1584922 to 9dad3a9 Compare November 28, 2023 17:46
@miguelff miguelff marked this pull request as ready for review November 28, 2023 17:47
@miguelff miguelff requested a review from a team as a code owner November 28, 2023 17:47
@miguelff miguelff requested review from jkomyno and Druue and removed request for a team November 28, 2023 17:47
@miguelff miguelff changed the title Fix panic kills running engine Fix panic kills running engine in query-engine-tests Nov 28, 2023
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.
@miguelff
Copy link
Contributor Author

There a many unrelated test failures after having rebased #4466

However ./build.sh && cargo test -p query-engine-tests new::interactive_tx -- --test-threads=1

Runs all the interactive_tx tests rather than failing on the first. See output:

output.txt

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();
Copy link
Contributor Author

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

@miguelff miguelff requested a review from SevInf November 28, 2023 18:30
Copy link
Member

@SevInf SevInf left a 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

@SevInf
Copy link
Member

SevInf commented Nov 29, 2023

Oh, one more thing, could we remove async_panic_to_js_error from wasm engine as well, just not to give anyone false impression that it does anything?

@SevInf
Copy link
Member

SevInf commented Nov 29, 2023

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?

@miguelff
Copy link
Contributor Author

Working on your feedback, will request review again when done.

@miguelff miguelff marked this pull request as draft November 29, 2023 09:34
@miguelff miguelff self-assigned this Nov 29, 2023
@miguelff
Copy link
Contributor Author

miguelff commented Nov 29, 2023

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?

I'm not sure I can reproduce:

cargo test -p query-engine-tests new::interactive_tx::interactive_tx -- --test-threads=1 2>&1 > test_run.txt

leads to test_run.txt, which has the when the tests run (rather than being reported at the end)

    Finished test [unoptimized + debuginfo] target(s) in 0.69s
     Running unittests src/lib.rs (target/debug/deps/query_engine_tests-2c035a45b52b38a9)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/query_engine_tests.rs (target/debug/deps/query_engine_tests-31e850527f6b4e11)

running 15 tests
test new::interactive_tx::interactive_tx::basic_commit_workflow ... panicked at /Users/miguel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand-0.8.5/src/rngs/thread.rs:72:17:
could not initialize thread_rng: Node.js ES modules are not directly supported, see https://docs.rs/getrandom#nodejs-es-module-support

Stack:

Error
    at __wbg_new_abda76e883ba8a5f (file:///Users/miguel/GitHub/prisma/prisma-engines/query-engine/query-engine-wasm/pkg/query_engine_bg.js:636:17)
    at wasm://wasm/010afe96:wasm-function[2584]:0x31c842
    at wasm://wasm/010afe96:wasm-function[4591]:0x35a8ba
    at wasm://wasm/010afe96:wasm-function[1467]:0x2aa7f8
    at wasm://wasm/010afe96:wasm-function[3183]:0x3362f7
    at wasm://wasm/010afe96:wasm-function[2781]:0x326028
    at wasm://wasm/010afe96:wasm-function[1002]:0x260378
    at wasm://wasm/010afe96:wasm-function[4048]:0x34fb85
    at wasm://wasm/010afe96:wasm-function[126]:0x7f6fe
    at wasm://wasm/010afe96:wasm-function[504]:0x1b9b9a


wasm://wasm/010afe96:1


RuntimeError: unreachable
    at wasm://wasm/010afe96:wasm-function[2584]:0x31c906
    at wasm://wasm/010afe96:wasm-function[4591]:0x35a8ba
    at wasm://wasm/010afe96:wasm-function[1467]:0x2aa7f8
    at wasm://wasm/010afe96:wasm-function[3183]:0x3362f7
    at wasm://wasm/010afe96:wasm-function[2781]:0x326028
    at wasm://wasm/010afe96:wasm-function[1002]:0x260378
    at wasm://wasm/010afe96:wasm-function[4048]:0x34fb85
    at wasm://wasm/010afe96:wasm-function[126]:0x7f6fe
    at wasm://wasm/010afe96:wasm-function[504]:0x1b9b9a
    at wasm://wasm/010afe96:wasm-function[143]:0x9dcec

Node.js v18.17.0
FAILED
test new::interactive_tx::interactive_tx::basic_rollback_workflow ... panicked at /Users/miguel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rand-0.8.5/src/rngs/thread.rs:72:17:
could not initialize thread_rng: Node.js ES modules are not directly supported, see https://docs.rs/getrandom#nodejs-es-module-support

Stack:
[...]

@miguelff miguelff marked this pull request as ready for review November 29, 2023 12:40
@miguelff miguelff merged commit 715c87f into feat/query-engine-wasm32-unknown-unknown Nov 29, 2023
50 of 62 checks passed
@miguelff miguelff deleted the mff/633-panics branch November 29, 2023 13:21
jkomyno added a commit that referenced this pull request Nov 30, 2023
SevInf added a commit that referenced this pull request Dec 8, 2023
* 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 <[email protected]>

---------

Co-authored-by: Joël Galeran <[email protected]>

---------

Co-authored-by: Miguel Fernandez <[email protected]>
Co-authored-by: Sergey Tatarintsev <[email protected]>
Co-authored-by: Jan Piotrowski <[email protected]>
Co-authored-by: Miguel Fernández <[email protected]>
Co-authored-by: Joël Galeran <[email protected]>
jkomyno added a commit that referenced this pull request Dec 18, 2023
…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 <[email protected]>
Co-authored-by: Sergey Tatarintsev <[email protected]>
Co-authored-by: Jan Piotrowski <[email protected]>
Co-authored-by: Miguel Fernández <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants