hasura / ndc-spec

NDC Specification and Reference Implementation
http://hasura.github.io/ndc-spec
20 stars 5 forks source link

[WINDOWS]: ndc-test crashes with stack overflow #81

Open BenoitRanque opened 10 months ago

BenoitRanque commented 10 months ago

Running ndc-test on windows crashes with a stack overflow.

Command:

cargo run --bin ndc-test -- test --endpoint http://localhost:8100 --snapshots-dir ../ndc-sdk-typescript/test-snapshots

Output:

├ Capabilities ...
│ ├ Fetching /capabilities ... OK
│ ├ Validating capabilities ... FAIL
├ Schema ...
│ ├ Fetching schema ... OK
│ ├ Validating schema ...
│ │ ├ object_types ... OK
│ │ ├ Collections ...
│ │ │ ├ articles ...
│ │ │ │ ├ Arguments ... OK
│ │ │ │ ├ Collection type ... OK
│ │ │ ├ authors ...
│ │ │ │ ├ Arguments ... OK
│ │ │ │ ├ Collection type ... OK
│ │ │ ├ articles_by_author ...
│ │ │ │ ├ Arguments ... OK
│ │ │ │ ├ Collection type ... OK
│ │ ├ Functions ...
│ │ │ ├ latest_article_id ...
│ │ │ │ ├ Result type ... OK
│ │ │ │ ├ Arguments ... OK
│ │ │ ├ Procedures ...
│ │ │ │ ├ upsert_article ...
│ │ │ │ │ ├ Result type ... OK
│ │ │ │ │ ├ Arguments ... OK
├ Query ...
│ ├ articles ...
│ │ ├ Simple queries ...

thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\ndc-test.exe test --endpoint http://localhost:8100 --snapshots-dir ../ndc-sdk-typescript/test-snapshots` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

This issue does not occur if tokio is forced to run in a single thread by annotating main with:

#[tokio::main(flavor = "current_thread")]
async fn main() {

Would not be surprised if this is an issue with some upstream library. Regardless, documenting the workaround here. This is something we should test for if/when we package ndc-test