libelektra: Rust test case fails on master

https://build.libelektra.org/jenkins/blue/organizations/jenkins/libelektra/detail/master/18/pipeline reports:

test kdb::test::can_use_kdb ... FAILED


failures:


---- kdb::test::can_use_kdb stdout ----

thread 'kdb::test::can_use_kdb' panicked at 'internal error: entered unreachable code', elektra/src/kdb.rs:318:17

note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.



failures:

    kdb::test::can_use_kdb


test result: FAILED. 32 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out


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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

What about closing this issue and opening another one if a Rust test case fails again?

This was an error I introduced in this PR and I thought it was related to this issue. But it’s actually unrelated, so unfortunately this issue is not fixed.

kdb.get(…) should return true if the keys were retrieved successfully, but false was returned, meaning “there was no update - no changes are made to the keyset then”. I don’t understand why it returns false instead of true.

Maybe there is no key in the backend of the used parentKey, then it also returns 0 as there is no change to the keyset.

Looks like test_rust_elektra failed in PR #3126.

156/260 Test  #34: test_rust_elektra .............................***Failed   53.30 sec
   Compiling cc v1.0.40
   Compiling libc v0.2.62
   Compiling memchr v2.2.1
   Compiling version_check v0.1.5
   Compiling bitflags v1.1.0
   Compiling lazy_static v1.3.0
   Compiling byteorder v1.3.2
   Compiling proc-macro2 v0.4.30
   Compiling log v0.4.8
   Compiling glob v0.3.0
   Compiling rustc-demangle v0.1.16
   Compiling cfg-if v0.1.9
   Compiling regex-syntax v0.6.11
   Compiling quick-error v1.2.2
   Compiling unicode-width v0.1.6
   Compiling unicode-xid v0.1.0
   Compiling strsim v0.8.0
   Compiling termcolor v1.0.5
   Compiling ansi_term v0.11.0
   Compiling bindgen v0.50.0
   Compiling vec_map v0.8.1
   Compiling peeking_take_while v0.1.2
   Compiling shlex v0.1.1
   Compiling thread_local v0.3.6
   Compiling nom v4.2.3
   Compiling backtrace-sys v0.1.31
   Compiling libloading v0.5.2
   Compiling humantime v1.2.0
   Compiling textwrap v0.11.0
   Compiling clang-sys v0.28.1
   Compiling fxhash v0.2.1
   Compiling atty v0.2.13
   Compiling aho-corasick v0.7.6
   Compiling quote v0.6.13
   Compiling clap v2.33.0
   Compiling backtrace v0.3.35
   Compiling failure v0.1.5
   Compiling cexpr v0.3.5
   Compiling regex v1.2.1
   Compiling which v2.0.1
   Compiling env_logger v0.6.2
   Compiling elektra-sys v0.9.0 (/home/jenkins/workspace/libelektra_PR-3126-IPADARSP3KMTTQ7U2PEWIJVQABRCHP2XCZ3DTXEC6ASQGMF6PDAQ/build directory/src/bindings/rust/elektra-sys)
   Compiling elektra v0.9.0 (/home/jenkins/workspace/libelektra_PR-3126-IPADARSP3KMTTQ7U2PEWIJVQABRCHP2XCZ3DTXEC6ASQGMF6PDAQ/build directory/src/bindings/rust/elektra)
    Finished dev [unoptimized + debuginfo] target(s) in 48.16s
     Running target/debug/deps/elektra-4964972aba2a8495

running 33 tests
test key::tests::can_duplicate_key ... ok
test key::tests::can_cast_key_types ... ok
test key::tests::can_delete_metadata ... ok
test key::tests::can_get_fullname ... ok
test key::tests::can_iterate_key ... ok
test key::tests::can_iterate_name ... ok
test key::tests::can_reference_count ... ok
test key::tests::can_set_get_metavalue ... ok
test key::tests::can_write_read_key_value ... ok
test key::tests::can_write_read_key ... ok
test key::tests::can_write_read_binary ... ok
test key::tests::equality_is_symmetric ... ok
test key::tests::equality_is_transitive ... ok
test key::tests::keys_are_ordered ... ok
test key::tests::keys_are_ordered_with_metadata ... ok
test keybuilder::test::can_build_binary_key ... ok
test keybuilder::test::can_build_key_with_meta ... ok
test keybuilder::test::can_build_string_key ... ok
test keyset::tests::can_build_simple_keyset ... ok
test keyset::tests::can_duplicate_keyset ... ok
test keyset::tests::can_iterate_simple_keyset ... ok
test keyset::tests::can_lookup_by_name_and_duplicate_key ... ok
test keyset::tests::can_lookup_key_with_nocase_and_pop_option ... ok
test keyset::tests::can_lookup_key_with_none_option ... ok
test keyset::tests::can_lookup_key_with_pop_option ... ok
test keyset::tests::can_use_popped_key_after_keyset_freed ... ok
test keyset::tests::extend_keyset_and_append_are_equal ... ok
test keyset::tests::pop_on_empty_keyset_returns_none ... ok
test key::tests::equality_is_reflexive ... ok
test key::tests::can_write_read_empty_binary ... ok
test key::tests::equality_is_exclusive ... ok
test key::tests::error_on_missing_metaname ... ok
test kdb::test::can_use_kdb ... FAILED

failures:

---- kdb::test::can_use_kdb stdout ----
thread 'kdb::test::can_use_kdb' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic
   9: <core::option::Option<T>>::unwrap
             at /usr/src/rustc-1.34.2/src/libcore/macros.rs:11
  10: elektra::kdb::test::remove_test_keys
             at elektra/src/kdb.rs:394
  11: elektra::kdb::test::can_use_kdb
             at elektra/src/kdb.rs:386
  12: elektra::kdb::test::can_use_kdb::{{closure}}
             at elektra/src/kdb.rs:360
  13: core::ops::function::FnOnce::call_once
             at /usr/src/rustc-1.34.2/src/libcore/ops/function.rs:231
  14: <F as alloc::boxed::FnBox<A>>::call_box
  15: __rust_maybe_catch_panic


failures:
    kdb::test::can_use_kdb

test result: FAILED. 32 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

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

It’s a different error this time unrelated to the error mapping. A Permanent(Logical(Internal(...))) error occurred, but it wasn’t printed out. So that’s all the information that I have. I’ll added a small fix to master for printing that as well, that’s all I can do unfortunately. Next time we can see the error if the same one happens again.

Some error code was given that wasn’t known to the mapper. The mapping for Installation (“C01200”) errors was missing and I added that in #3047.

But that doesn’t really explain why there occurred an error in the first place. The test case isn’t raising an error. And the latest PR #3038 you merged didn’t even touch the rust bindings. I’ll try to figure it out in the PR above.