Skip to content

Flaky (Deadlock Detected) krate tests. #4729

Closed
@adsnaider

Description

@adsnaider

Current Behavior

While contributing to crates.io for #4690, I got failures from some krate tests during development. I reran the tests and the failures were gone. I figured I would post the issue so that we have a record of this behavior.

Here's the test output I got. However, it's hard to reproduce since there seems to be some flakiness.

failures:

---- krate::show::show_minimal stdout ----
thread 'krate::show::show_minimal' panicked at 'Unable to create crate foo_show_minimal: DatabaseError(__Unknown, "deadlock detected")', src/tests/builders/krate.rs:181:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- krate::summary::excluded_crate_id stdout ----
thread 'krate::summary::excluded_crate_id' panicked at 'Unable to create crate some_downloads: DatabaseError(__Unknown, "deadlock detected")', src/tests/builders/krate.rs:181:13

---- krate::search::index_queries stdout ----
thread 'krate::search::index_queries' panicked at 'called `Result::unwrap()` on an `Err` value: DatabaseError(__Unknown, "deadlock detected")', src/tests/krate/search.rs:85:14


failures:
    krate::search::index_queries
    krate::show::show_minimal
    krate::summary::excluded_crate_id

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

Expected Behavior

Tests are deterministic.

Steps To Reproduce

cargo test and hope for the worst.

Environment

  • Browser: N/A (backend issue only)
  • OS: PopOS 21.04

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-backend ⚙️C-internal 🔧Category: Nonessential work that would make the codebase more consistent or clear

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions