Diggsey / ijson

More efficient alternative to `serde_json::Value` which saves memory by interning primitive values and using tagged pointers.
Apache License 2.0
127 stars 14 forks source link

Tests failure #13

Closed MeirShpilraien closed 2 years ago

MeirShpilraien commented 2 years ago

Hey, thanks for developing this repository. I was testing it out and did not encounter any issues (yet) but when I run the tests with cargo test I get those failures:

    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests (target/debug/deps/ijson-db092e477d316bcc)

running 27 tests
test array::tests::can_collect ... ok
test array::tests::can_nest ... ok
test array::tests::can_push_insert ... ok
test array::tests::can_swap_remove ... ok
test array::tests::can_pop_remove ... ok
test array::tests::can_index ... ok
test array::tests::can_create ... ok
test array::tests::can_truncate_and_shrink ... ok
test number::tests::can_create ... ok
test number::tests::can_store_various_numbers ... ok
test object::tests::can_create ... ok
test number::tests::can_compare_various_numbers ... ok
test object::tests::can_insert ... ok
test object::tests::can_collect ... FAILED
test object::tests::can_remove_and_shrink ... ok
test object::tests::can_nest ... FAILED
test string::tests::can_intern ... ok
test string::tests::default_interns_string ... FAILED
test value::tests::test_bool ... ok
test value::tests::test_null ... ok
test value::tests::can_use_literal ... ok
test value::tests::test_array ... ok
test value::tests::test_string ... ok
test value::tests::test_number ... ok
test value::tests::test_object ... ok
test array::tests::stress_test ... ok
test object::tests::stress_test ... ok

failures:

---- object::tests::can_collect stdout ----
thread 'object::tests::can_collect' panicked at 'called `Result::unwrap()` on an `Err` value: Leak', /home/meir/.cargo/registry/src/github.com-1ecc6299db9ec823/mockalloc-0.1.2/src/lib.rs:434:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- object::tests::can_nest stdout ----
thread 'object::tests::can_nest' panicked at 'called `Result::unwrap()` on an `Err` value: DoubleFree', /home/meir/.cargo/registry/src/github.com-1ecc6299db9ec823/mockalloc-0.1.2/src/lib.rs:434:21

---- string::tests::default_interns_string stdout ----
thread 'string::tests::default_interns_string' panicked at 'called `Result::unwrap()` on an `Err` value: NoData', /home/meir/.cargo/registry/src/github.com-1ecc6299db9ec823/mockalloc-0.1.2/src/lib.rs:434:21

failures:
    object::tests::can_collect
    object::tests::can_nest
    string::tests::default_interns_string

test result: FAILED. 24 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.79s

error: test failed, to rerun pass '--lib'

Its not stable and I get different failures each time. Any suggestions?

Diggsey commented 2 years ago

You need to use -- --test-threads=1

Diggsey commented 2 years ago

(This is because it runs a custom allocator to detect memory leaks, which only supports single-threaded test runs)

MeirShpilraien commented 2 years ago

Works! Thanks