plex-api.rs icon indicating copy to clipboard operation
plex-api.rs copied to clipboard

Test server sometimes reporting missing items

Open Mossop opened this issue 2 years ago • 2 comments

I hadn't seen this before today but suddenly I'm starting to see the odd failure in tests where we're trying to list the contents of a library and getting nothing. Not sure if it's because the server returned nothing or we failed to parse but it's intermittent. Here is a log from the worst case I've hit:

---- online::music_playlists::unclaimed_server stdout ----
thread 'online::music_playlists::unclaimed_server' panicked at 'assertion failed: `(left == right)`
  left: `[]`,
 right: `["Best Music"]`', crates/plex-api/tests/server.rs:844:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- online::photos::unclaimed_server stdout ----
thread 'online::photos::unclaimed_server' panicked at 'called `Result::unwrap()` on an `Err` value: UnexpectedApiResponse { status_code: 500, content: "<html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>" }', crates/plex-api/tests/server.rs:885:45

---- online::photos_playlists::unclaimed_server stdout ----
thread 'online::photos_playlists::unclaimed_server' panicked at 'assertion failed: `(left == right)`
  left: `[]`,
 right: `["Cats"]`', crates/plex-api/tests/server.rs:936:9

---- online::tv::unclaimed_server stdout ----
thread 'online::tv::unclaimed_server' panicked at 'called `Result::unwrap()` on an `Err` value: UnexpectedApiResponse { status_code: 500, content: "<html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>" }', crates/plex-api/tests/server.rs:521:43

---- online::tv_playlists::unclaimed_server stdout ----
thread 'online::tv_playlists::unclaimed_server' panicked at 'assertion failed: `(left == right)`
  left: `[]`,
 right: `["Episodes with H", "Mixed", "Pilot"]`', crates/plex-api/tests/server.rs:719:9


failures:
    online::music_playlists::unclaimed_server
    online::photos::unclaimed_server
    online::photos_playlists::unclaimed_server
    online::tv::unclaimed_server
    online::tv_playlists::unclaimed_server

Mossop avatar Apr 19 '23 19:04 Mossop

How reproducible is this thing?

Do you wait for the server to boot completely? Does cargo run -p plex-cli -- wait --full finishes without delay with the server where you have the issue?

I had this issue a few times, but not after I added wait --full to the tests flow.

worried-networking avatar Apr 19 '23 19:04 worried-networking

Not very reproducible. I've seen it maybe three times in the maybe 20 times I've run the tests this evening. All those test runs were against main or my patches though.

Mossop avatar Apr 19 '23 19:04 Mossop