Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Tests modification for windows CI #9671

Merged
merged 5 commits into from
Oct 31, 2018
Merged

Tests modification for windows CI #9671

merged 5 commits into from
Oct 31, 2018

Conversation

cheme
Copy link
Contributor

@cheme cheme commented Sep 28, 2018

Running tests on windows, fixing some path to string conversion and others windows specifics :

  • change of duration value in corpus_inaccessible because of substract overflow happening on windows
  • right color configuration for test_command_signer_new_token
  • extend delay for keyserver test.
  • deactivate guards_delete_folder due to error on removal when guards is dropped
  • deactivate should_allow_if_authorization_is_correct (timeout error is thrown)

At the time those changes allows the test to run on windows 10 vm, but on the windows CI there is still a segfault on specific tests (probably rocksdb related or related to temp path issue) :

test snapshot::service::tests::cannot_finish_with_invalid_chunks ... error: test failed, to rerun pass '--lib'
/c/r/builds/f8bd3cf5/0/parity/parity-ethereum/test.sh: line 59:  2224 Segmentation fault      cargo test $OPTIONS --features "$FEATURES" --all $1 -- --test-threads 1

@parity-cla-bot
Copy link

It looks like @cheme signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@NikVolf NikVolf added A0-pleasereview 🤓 Pull request needs code review. M1-ci 🙉 Continuous integration. labels Sep 28, 2018
@@ -310,8 +310,10 @@ mod test {

#[test]
fn make_vault_dir_path_succeeds() {
assert_eq!(make_vault_dir_path("/home/user/parity", "vault", true).unwrap().to_str().unwrap(), "/home/user/parity/vault");
assert_eq!(make_vault_dir_path("/home/user/parity", "*bad-name*", false).unwrap().to_str().unwrap(), "/home/user/parity/*bad-name*");
use std::path::Path;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces here

@5chdn 5chdn added this to the 2.2 milestone Sep 29, 2018
@cheme cheme removed the A0-pleasereview 🤓 Pull request needs code review. label Oct 1, 2018
@@ -186,7 +186,7 @@ mod tests {

{
let corpus_time = &mut cache.corpus.as_mut().unwrap().1;
*corpus_time = *corpus_time - Duration::from_secs(6 * 3600);
*corpus_time = *corpus_time - Duration::from_secs(5 * 3600);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It substracts overflow otherwhise (of course that is only happening on windows). That looks like a windows bug/inconsistency with duration.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂️ please describe it in the comment

// on windows the guards deletion (remove_dir_all)
// is not happening (error directory is not empty).
// So the test is disabled until windows api behave.
#[cfg(not(target_os = "windows"))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you tell something more about the error returned? Why is it not happening? According to the documentation

Removes a directory at this path, after removing all its contents. Use carefully!

It should happen

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error is a simple 'directory is not empty', looking at rust-lang/rust#29497 which exists since 2015, I may have been a bit optimistic in saying that there will be a fix someday, we may probably want to use https://crates.io/crates/remove_dir_all .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I ran a test with the 'remove_dir_all' crate, and it is not better : we obtain an "os 32" error "the process cannot access this file because it is used by another process". Solving it will be probably a bit harder than expected, it should probably have its own issue and PR.

let _ = view!(HeaderView, &[]).parent_hash();
}
#[test]
#[should_panic]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove the panic message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The windows panic message contains '' instead of '/' in the file path of the error message. Another option could be to have a copy of this tests for windows.

@@ -105,6 +105,7 @@ mod testing {
http_client::assert_security_headers_present(&response.headers, None);
}

#[cfg(not(target_os = "windows"))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this test ignored? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not identify the root of the issue, the test is failing on a connection timeout.

use std::path::Path;

assert_eq!(&make_vault_dir_path("/home/user/parity", "vault", true).unwrap(), &Path::new("/home/user/parity/vault"));
assert_eq!(&make_vault_dir_path("/home/user/parity", "*bad-name*", false).unwrap(), &Path::new("/home/user/parity/*bad-name*"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

let std = parse(&["parity"]);
let base = parse(&["parity", "--base-path", "/test"]);

let base_path = ::dir::default_data_path();
let local_path = ::dir::default_local_path();
assert_eq!(std.directories().cache, dir::helpers::replace_home_and_local(&base_path, &local_path, ::dir::CACHE_PATH));
assert_eq!(base.directories().cache, "/test/cache");
assert_eq!(path::Path::new(&base.directories().cache), path::Path::new("/test/cache"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@debris debris added the M4-core ⛓ Core client code / Rust. label Oct 1, 2018
@5chdn 5chdn added the A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. label Oct 1, 2018
@5chdn
Copy link
Contributor

5chdn commented Oct 8, 2018

what's the status of this?

@5chdn 5chdn added A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Oct 8, 2018
@cheme
Copy link
Contributor Author

cheme commented Oct 8, 2018

I think there is valid fixes for windows test that should be merged, there is also two skipped tests, so before merging a issue should be created (one is about directory deletion failing on windows and is not that trivial, the other one is not identified).
With this PR I could run test on a windows 10 VM, but the integration seems still broken : to see the issue in integration you need to change test.sh to run on one thread and you see a 'segfault' error. This segfault may be related to ci envt or related to #9702 .
For this PR I am in favor of merging it and creating another issue for the directory deletion test and maybe for the ci segfault in devops.

@5chdn 5chdn added A0-pleasereview 🤓 Pull request needs code review. and removed A3-stale 🍃 Pull request did not receive any updates in a long time. No review needed at this stage. Close it. labels Oct 8, 2018
@5chdn 5chdn requested review from ascjones and ordian October 26, 2018 11:42
@5chdn
Copy link
Contributor

5chdn commented Oct 26, 2018

Could you review this @ordian @ascjones ?

@5chdn 5chdn modified the milestones: 2.2, 2.3 Oct 29, 2018
Copy link
Collaborator

@ordian ordian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of merging this PR, but note, that:

  1. I don't have a Windows machine atm to test this (but will by the end of this week, not sure if VM is representative enough).
  2. Not sure whether it's worth the effort if we merge ci: remove failing tests for android, windows, and macos #9788.
  3. It doesn't fix tests on our Windows CI, but seems like a reasonable step towards making it happen.

Copy link
Contributor

@ascjones ascjones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @ordian. Changes LGTM but I was waiting to run it on my Windows machine, but that is back in London.

@5chdn 5chdn added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Oct 31, 2018
@5chdn
Copy link
Contributor

5chdn commented Oct 31, 2018

Merging, it's Windows ;)

@5chdn 5chdn merged commit 39f25d2 into master Oct 31, 2018
@5chdn 5chdn deleted the ec-winfix branch October 31, 2018 10:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M1-ci 🙉 Continuous integration. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants