nroi / flexo

a central pacman cache
MIT License
172 stars 10 forks source link

Integration tests failing on latest build #115

Closed sovanyio closed 8 months ago

sovanyio commented 9 months ago

Describe the bug Integration tests fail. Tried clean AUR builds and uninstalling and clean reinstalling and integration tests fail every time.

Installation method AUR

Distribution Plain Arch

Version v1.6.9-4 through v1.6.9-6 Log

Running tests/integration_test.rs (target/debug/deps/integration_test-87ab0dbd66dd9f70)

running 17 tests
test job_continued_after_partial_completion ... FAILED
test job_panic_results_in_main_panic - should panic ... ok
test best_provider_selected ... ok
test downgrade_provider ... FAILED
test next_order_success_after_first_order_failed ... ok
test no_downgrade_if_all_providers_fail ... ok
test no_infinite_loop ... ok
test provider_lowest_score ... ok
test no_new_channel_established ... FAILED
test provider_reused_after_job_completed ... FAILED
test new_channel_established_because_channel_in_use has been running for over 60 seconds
test order_skipped_if_already_in_progress has been running for over 60 seconds
test provider_no_two_simultaneous_jobs has been running for over 60 seconds
test provider_two_simultaneous_jobs_if_required has been running for over 60 seconds
^C
==> ERROR: Aborted by user! Exiting...
==> Cleaning up...
desbma commented 9 months ago

To add more context: only integration tests seem to fail, I have disabled them in 1.6.9-7 package version. I could not reproduce the integration tests failure, but at least two people had the issue: https://aur.archlinux.org/packages/flexo#comment-944300

nroi commented 9 months ago

@sovanyio can you please run this command and show the full output? From the output you have pasted, I cannot see why exactly the test cases have failed because you've aborted the command before it ran to completion, but the following command should hopefully show more details about why the test has failed:

cargo test job_continued_after_partial_completion
sovanyio commented 8 months ago

Sure thing, the tests hang indefinitely after the output I posted. Here's the output you requested:

I checked out the last PKGBUILD with the issue and it indeed hung, I opened a new terminal with the hung test still waiting and the command appears to complete successfully despite the makepkg test error in the other tab:

(f0f12a5) [130] % cargo test job_continued_after_partial_completion                     ~/.cache/yay/flexo/src/flexo-1.6.9/flexo
   Compiling autocfg v1.1.0
   Compiling libc v0.2.126
   Compiling pkg-config v0.3.25
   Compiling cc v1.0.73
   Compiling proc-macro2 v1.0.40
   Compiling quote v1.0.20
   Compiling unicode-ident v1.0.1
   Compiling syn v1.0.98
   Compiling crossbeam-utils v0.8.10
   Compiling openssl-sys v0.9.74
   Compiling libz-sys v1.1.8
   Compiling once_cell v1.12.0
   Compiling serde_derive v1.0.138
   Compiling memoffset v0.6.5
   Compiling memchr v2.5.0
   Compiling serde v1.0.138
   Compiling curl-sys v0.4.55+curl-7.83.1
   Compiling getrandom v0.2.7
   Compiling num-traits v0.2.15
   Compiling crossbeam-epoch v0.9.9
   Compiling num-integer v0.1.45
   Compiling scopeguard v1.1.0
   Compiling log v0.4.17
   Compiling crossbeam-queue v0.3.5
   Compiling aho-corasick v0.7.18
   Compiling rand_core v0.6.3
   Compiling serde_json v1.0.82
   Compiling itoa v1.0.2
   Compiling httparse v1.7.1
   Compiling curl v0.4.43
   Compiling ppv-lite86 v0.2.16
   Compiling regex-syntax v0.6.26
   Compiling rand_chacha v0.3.1
   Compiling crossbeam-deque v0.8.1
   Compiling crossbeam-channel v0.5.5
   Compiling atty v0.2.14
   Compiling time v0.1.44
   Compiling socket2 v0.4.4
   Compiling regex v1.5.6
   Compiling openssl-probe v0.1.5
   Compiling termcolor v1.1.3
   Compiling bytes v1.1.0
   Compiling same-file v1.0.6
   Compiling ryu v1.0.10
   Compiling rustc-serialize v0.3.24
   Compiling fnv v1.0.7
   Compiling humantime v2.1.0
   Compiling env_logger v0.9.0
   Compiling http v0.2.8
   Compiling walkdir v2.3.2
   Compiling crossbeam v0.8.1
   Compiling rand v0.8.5
   Compiling toml v0.5.9
   Compiling chrono v0.4.19
   Compiling uuid v0.8.2
   Compiling httpdate v1.0.2
   Compiling glob v0.3.0
   Compiling fastrand v1.7.0
   Compiling remove_dir_all v0.5.3
   Compiling flexo v1.6.9 (/home/brian/.cache/yay/flexo/src/flexo-1.6.9/flexo)
   Compiling tempfile v3.3.0
warning: fields `handle` and `state` are never read
   --> tests/integration_test.rs:252:5
    |
251 | struct DummyChannel {
    |        ------------ fields in this struct
252 |     handle: i32,
    |     ^^^^^^
253 |     collector: JobState<DummyJob>,
254 |     state: DummyChannelState,
    |     ^^^^^
    |
    = note: `DummyChannel` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    = note: `#[warn(dead_code)]` on by default

warning: variable does not need to be mutable
   --> src/mirror_flexo.rs:757:13
    |
757 |         let mut job_resources = self.job_state.job_resources.as_mut().unwrap();
    |             ----^^^^^^^^^^^^^
    |             |
    |             help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

warning: `flexo` (test "integration_test") generated 1 warning
warning: `flexo` (bin "flexo" test) generated 1 warning (run `cargo fix --bin "flexo" --tests` to apply 1 suggestion)
warning: `flexo` (bin "flexo") generated 1 warning (1 duplicate)
    Finished test [unoptimized + debuginfo] target(s) in 1m 09s
warning: the following packages contain code that will be rejected by a future version of Rust: rustc-serialize v0.3.24
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
     Running unittests src/lib.rs (target/debug/deps/flexo-fff988cf3b9a49a1)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running unittests src/main.rs (target/debug/deps/flexo-1082c70548b1c681)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 10 filtered out; finished in 0.00s

     Running tests/integration_test.rs (target/debug/deps/integration_test-1d4a87438793122a)

running 1 test
test job_continued_after_partial_completion ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 16 filtered out; finished in 0.00s
nroi commented 8 months ago

For the time being, I'd like to close this and propose to the maintainer of the AUR package to just disable the tests. The tests were never intended to be run during the build process by normal users and don't provide much value there. Anyone who experiences those issues with test cases failing on their machine can provide more information to me if they want to, e.g. if you have some output that shows more than just which test cases have failed, but also why they have failed, please do so. But with the limited information available, and no way of reproducing this issue on my machine, troubleshooting this issue feels like going down a rabbit hole that just consumes much time for little value.