Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite fails when run with a single core #6746

Closed
ipetkov opened this issue Mar 14, 2019 · 8 comments · Fixed by #6900
Closed

Test suite fails when run with a single core #6746

ipetkov opened this issue Mar 14, 2019 · 8 comments · Fixed by #6900
Labels
A-testing-cargo-itself Area: cargo's tests C-bug Category: bug

Comments

@ipetkov
Copy link

ipetkov commented Mar 14, 2019

Problem
Cargo testsuite fails when built with the rustc-1.33.0-src tarball with vendor = true enabled. Though I haven't confirmed it yet, the issue may also exist if cargo itself is built with vendored crates.

Specifically, the test suite appears to expect error messages like [..]Cargo.toml but with vendoring enabled, messages will look like </path/to/vendor/dir>/Cargo.toml

Steps

  1. Download the rustc-1.33.0-src tarball
  2. Edit config.toml and set the vendor = true flag
  3. ./x.py test src/tools/cargo

Possible Solution(s)

  • Update the test suite to understand if vendoring is currently enabled and react accordingly
  • Have the test instance of cargo ignore any .cargo config directories in the parent hierarchy

Notes

@ipetkov ipetkov added the C-bug Category: bug label Mar 14, 2019
@ipetkov
Copy link
Author

ipetkov commented Mar 14, 2019

Test cases which fail:

 alt_registry::depend_on_alt_registry_depends_on_crates_io
    alt_registry::depend_on_alt_registry_depends_on_same_registry
    alt_registry::depend_on_alt_registry_depends_on_same_registry_no_index
    alt_registry::no_api
    alt_registry::patch_alt_reg
    alt_registry::publish_to_alt_registry
    alt_registry::publish_with_crates_io_dep
    alt_registry::publish_with_registry_dependency
    alt_registry::registry_and_path_dep_works
    alt_registry::unknown_registry
    bad_config::empty_dependencies
    build::build_all_member_dependency_same_name
    build::building_a_dependent_crate_witout_bin_should_fail
    build::cargo_compile_with_downloaded_dependency_with_offline
    build::compile_offline_while_transitive_dep_not_cached
    build::compile_offline_without_maxvers_cached
    build::incompatible_dependencies
    build::incompatible_dependencies_with_multi_semver
    build_script::deterministic_rustc_dependency_flags
    build_script::warnings_hidden_for_upstream
    build_script::warnings_printed_on_vv
    cargo_command::cargo_help_external_subcommand
    cargo_command::find_closest_biuld_to_build
    cargo_command::override_cargo_home
    cargo_features::publish_allowed
    cfg::ignore_version_from_other_platform
    cfg::works_through_the_registry
    clean::clean_verbose
    clean::registry
    concurrent::concurrent_installs
    concurrent::multiple_registry_fetches
    concurrent::one_install_should_be_bad
    directory::bad_file_checksum
    directory::crates_io_then_bad_checksum
    directory::crates_io_then_directory
    directory::git_lock_file_doesnt_change
    directory::git_override_requires_lockfile
    directory::install_without_feature_dep
    directory::multiple
    directory::not_there
    directory::only_dot_files_ok
    directory::random_files_ok
    directory::simple
    directory::simple_install
    directory::simple_install_fail
    directory::version_missing
    doc::issue_5345
    features::combining_features_and_package
    freshness::bust_patched_dep
    freshness::no_rebuild_when_rename_dir
    freshness::path_dev_dep_registry_updates
    freshness::unused_optional_dep
    init::bin_already_exists_explicit
    init::bin_already_exists_explicit_nosrc
    init::bin_already_exists_implicit
    init::bin_already_exists_implicit_namenosrc
    init::bin_already_exists_implicit_namesrc
    init::bin_already_exists_implicit_nosrc
    init::cargo_lock_gitignored_if_lib1
    init::cargo_lock_gitignored_if_lib2
    init::cargo_lock_not_gitignored_if_bin1
    init::cargo_lock_not_gitignored_if_bin2
    init::confused_by_multiple_lib_files
    init::git_autodetect
    init::gitignore_added_newline_in_existing
    init::gitignore_appended_not_replaced
    init::gitignore_no_newline_in_new
    init::lib_already_exists_nosrc
    init::lib_already_exists_src
    init::mercurial_added_newline_in_existing
    init::mercurial_autodetect
    init::mercurial_no_newline_in_new
    init::multibin_project_name_clash
    init::simple_bin
    init::simple_git
    init::simple_git_ignore_exists
    init::simple_lib
    init::with_argument
    install::compile_failure
    install::custom_target_dir_for_git_source
    install::dev_dependencies_lock_file_untouched
    install::dev_dependencies_no_check
    install::do_not_rebuilds_on_local_install
    install::examples
    install::git_repo
    install::git_repo_replace
    install::git_with_lockfile
    install::install_force
    install::install_force_bin
    install::install_force_partial_overlap
    install::install_global_cargo_config
    install::install_ignores_local_cargo_config
    install::install_location_precedence
    install::install_path
    install::install_respects_lock_file
    install::install_target_native
    install::install_twice
    install::installs_beta_version_by_explicit_name_from_git
    install::installs_from_cwd_by_default
    install::legacy_version_requirement
    install::list
    install::list_error
    install::lock_file_path_deps_ok
    install::missing
    install::multiple_crates_auto_binaries
    install::multiple_crates_auto_examples
    install::multiple_crates_git_all
    install::multiple_crates_select
    install::multiple_pkgs
    install::no_crate
    install::pick_max_version
    install::q_silences_warnings
    install::readonly_dir
    install::reports_unsuccessful_subcommand_result
    install::simple
    install::subcommand_works_out_of_the_box
    install::uninstall_bin_does_not_exist
    install::uninstall_cwd
    install::uninstall_cwd_no_project
    install::uninstall_cwd_not_installed
    install::uninstall_multiple_and_some_pkg_does_not_exist
    install::uninstall_piecemeal
    install::uninstall_pkg_does_not_exist
    install::use_path_workspace
    install::vers_precise
    install::version_too
    install::workspace_uses_workspace_target_dir
    jobserver::jobserver_and_j
    jobserver::jobserver_exists
    jobserver::makes_jobserver_used
    local_registry::crates_io_registry_url_is_optional
    local_registry::different_directory_replacing_the_registry_is_bad
    local_registry::interdependent
    local_registry::invalid_dir_bad
    local_registry::multiple_names
    local_registry::multiple_versions
    local_registry::path_dep_rewritten
    local_registry::simple
    lockfile_compat::current_lockfile_format
    lockfile_compat::frozen_flag_preserves_old_lockfile
    lockfile_compat::locked_correct_error
    lockfile_compat::lockfile_without_root
    lockfile_compat::oldest_lockfile_still_works
    lockfile_compat::totally_wild_checksums_works
    lockfile_compat::unlisted_checksum_is_bad_if_we_calculate
    lockfile_compat::wrong_checksum_is_an_error
    login::registry_credentials
    metabuild::metabuild_basic
    metabuild::metabuild_build_plan
    metabuild::metabuild_external_dependency
    metabuild::metabuild_failed_build_json
    metabuild::metabuild_fresh
    metabuild::metabuild_json_artifact
    metabuild::metabuild_lib_name
    metabuild::metabuild_links
    metabuild::metabuild_optional_dep
    metabuild::metabuild_override
    metabuild::metabuild_two_versions
    metabuild::metabuild_workspace
    metadata::cargo_metadata_path_to_cargo_toml_project
    metadata::cargo_metadata_with_deps_and_version
    metadata::rename_dependency
    new::existing
    new::explicit_invalid_name_not_suggested
    new::explicit_project_name
    new::finds_author_email
    new::finds_author_priority
    new::finds_author_user
    new::finds_author_user_escaped
    new::finds_author_username
    new::finds_git_author
    new::finds_git_email
    new::git_prefers_command_line
    new::new_default_edition
    new::new_with_edition_2015
    new::new_with_edition_2018
    new::reserved_name
    new::simple_bin
    new::simple_git
    new::simple_lib
    new::strip_angle_bracket_author_email
    new::subpackage_git_with_gitignore
    new::subpackage_git_with_vcs_arg
    new::subpackage_no_git
    out_dir::avoid_build_scripts
    out_dir::binary_with_debug
    out_dir::dynamic_library_with_debug
    out_dir::include_only_the_binary_from_the_current_package
    out_dir::out_dir_is_a_file
    out_dir::replaces_artifacts
    out_dir::rlib_with_debug
    out_dir::static_library_with_debug
    overrides::broken_path_override_warns
    overrides::locked_means_locked_yes_no_seriously_i_mean_locked
    overrides::multiple_specs
    overrides::no_override_self
    overrides::no_warnings_when_replace_is_used_in_another_workspace_member
    overrides::override_adds_some_deps
    overrides::override_an_override
    overrides::override_plus_dep
    overrides::override_simple
    overrides::override_to_path_dep
    overrides::override_with_default_feature
    overrides::override_with_nothing
    overrides::override_wrong_name
    overrides::overriding_nonexistent_no_spurious
    overrides::paths_add_optional_bad
    overrides::paths_ok_with_optional
    overrides::persists_across_rebuilds
    overrides::replace_registry_with_path
    overrides::replace_to_path_dep
    overrides::test_override_dep
    overrides::transitive
    overrides::update
    overrides::use_a_spec_to_select
    package::do_not_package_if_src_was_modified
    package::generated_manifest
    package::ignore_nested
    package::lock_file_and_workspace
    package::metadata_warning
    package::no_duplicates_from_modified_tracked_files
    package::no_lock_file_with_library
    package::package_lib_with_bin
    package::package_lockfile
    package::package_no_default_features
    package::package_two_kinds_of_deps
    package::package_verbose
    package::package_verification
    package::package_with_all_features
    package::package_with_select_features
    package::repackage_on_source_change
    package::simple
    package::test_edition
    patch::add_ignored_patch
    patch::add_patch
    patch::new_major
    patch::new_minor
    patch::no_warn_ws_patch
    patch::nonexistent
    patch::patch_depends_on_another_patch
    patch::patch_git
    patch::patch_in_virtual
    patch::patch_to_git
    patch::remove_patch
    patch::replace
    patch::replace_prerelease
    patch::replace_with_crates_io
    patch::transitive_new_major
    patch::transitive_new_minor
    patch::unused
    patch::unused_git
    path::cargo_compile_with_nested_deps_shorthand
    path::cargo_compile_with_root_dev_deps
    path::cargo_compile_with_root_dev_deps_with_testing
    path::cargo_compile_with_transitive_dev_deps
    path::custom_target_no_rebuild
    path::deep_dependencies_trigger_rebuild
    path::dev_deps_no_rebuild_lib
    path::invalid_path_dep_in_workspace_with_lockfile
    path::nested_deps_recompile
    path::no_rebuild_dependency
    path::no_rebuild_two_deps
    path::override_and_depend
    path::override_path_dep
    path::override_relative
    path::override_self
    path::path_dep_build_cmd
    path::thin_lto_works
    path::workspace_produces_rlib
    plugins::doctest_a_plugin
    plugins::native_plugin_dependency_with_custom_ar_linker
    plugins::plugin_integration
    proc_macro::impl_and_derive
    proc_macro::noop
    proc_macro::probe_cfg_before_crate_type_discovery
    proc_macro::proc_macro_crate_type
    proc_macro::proc_macro_crate_type_warning
    proc_macro::proc_macro_crate_type_warning_plugin
    proc_macro::proc_macro_doctest
    profile_config::profile_config_all_options
    profile_config::profile_config_gated
    profile_config::profile_config_no_warn_unknown_override
    profile_config::profile_config_override_precedence
    profile_config::profile_config_override_spec_multiple
    profile_config::profile_config_validate_warnings
    profile_overrides::profile_override_basic
    profile_overrides::profile_override_hierarchy
    profile_targets::profile_selection_bench
    profile_targets::profile_selection_build
    profile_targets::profile_selection_build_all_targets
    profile_targets::profile_selection_build_all_targets_release
    profile_targets::profile_selection_build_release
    profile_targets::profile_selection_doc
    profile_targets::profile_selection_test
    profile_targets::profile_selection_test_release
    profiles::debug_override_1
    profiles::opt_level_override_0
    profiles::profile_in_non_root_manifest_triggers_a_warning
    profiles::profile_in_virtual_manifest_works
    profiles::profile_overrides
    profiles::top_level_overrides_deps
    publish::block_publish_feature_not_enabled
    publish::block_publish_no_registry
    publish::dont_publish_dirty
    publish::dry_run
    publish::git_deps
    publish::old_token_location
    publish::path_dependency_no_version
    publish::publish_allowed_registry
    publish::publish_empty_list
    publish::registry_not_in_publish_list
    publish::simple
    publish::simple_with_host
    publish::simple_with_index_and_host
    publish::unpublishable_crate
    registry::add_dep_dont_update_registry
    registry::bad_and_or_malicious_packages_rejected
    registry::bad_cksum
    registry::bump_version_dont_update_registry
    registry::bundled_crate_in_registry
    registry::deps
    registry::dev_dependency_not_used
    registry::disallow_network
    registry::fetch_downloads
    registry::git_and_registry_dep
    registry::git_init_templatedir_missing
    registry::lockfile_locks
    registry::lockfile_locks_transitively
    registry::login_with_no_cargo_dir
    registry::mis_hyphenated
    registry::nonexistent
    registry::old_version_req
    registry::old_version_req_upstream
    registry::only_download_relevant
    registry::package_with_path_deps
    registry::relying_on_a_yank_is_bad
    registry::rename_deps_and_features
    registry::simple
    registry::toml_lies_but_index_is_truth
    registry::update_backtracking_ok
    registry::update_lockfile
    registry::update_multiple_packages
    registry::update_offline
    registry::update_publish_then_update
    registry::update_registry
    registry::update_same_prefix_oh_my_how_was_this_a_bug
    registry::update_transitive_dependency
    registry::update_with_lockfile_if_packages_missing
    registry::updating_a_dep
    registry::upstream_warnings_on_extra_verbose
    registry::use_semver
    registry::vv_prints_warnings
    registry::wrong_case
    registry::wrong_version
    registry::yanks_are_not_used
    registry::yanks_in_lockfiles_are_ok
    registry::yanks_in_lockfiles_are_ok_for_other_update
    registry::yanks_in_lockfiles_are_ok_with_new_dep
    rename_deps::can_run_doc_tests
    rename_deps::features_still_work
    rename_deps::lots_of_names
    rename_deps::rename_affects_fingerprint
    rename_deps::rename_dependency
    rename_deps::rename_twice
    required_features::build_bin_default_features
    required_features::build_example_default_features
    required_features::build_example_multiple_required_features
    required_features::dep_feature_in_cmd_line
    required_features::dep_feature_in_toml
    required_features::install_arg_features
    required_features::install_default_features
    required_features::install_multiple_required_features
    required_features::run_default
    required_features::run_default_multiple_required_features
    required_features::test_arg_features
    required_features::test_default_features
    required_features::test_multiple_required_features
    required_features::test_skips_compiling_bin_with_missing_required_features
    resolve::minimal_version_cli
    run::autobins_disables
    run::bogus_default_run
    run::default_run_unstable
    run::either_name_or_example
    run::example_with_release_flag
    run::exit_code
    run::exit_code_verbose
    run::no_main_file
    run::one_bin_multiple_examples
    run::release_works
    run::run_bin_example
    run::run_example
    run::run_from_executable_folder
    run::run_library_example
    run::run_with_filename
    run::run_workspace
    run::simple
    run::specify_name
    run::too_many_bins
    rustc::build_foo_with_bar_dependency
    rustc::build_lib_for_foo
    rustc::build_main_and_allow_unstable_options
    rustc::build_only_bar_dependency
    rustc::build_with_args_to_one_of_multiple_binaries
    rustc::build_with_args_to_one_of_multiple_tests
    rustc::fails_when_trying_to_build_main_and_lib_with_args
    rustc::fails_with_args_to_all_binaries
    rustc::lib
    rustc::rustc_fingerprint
    rustdoc::rustdoc_args
    rustdoc::rustdoc_foo_with_bar_dependency
    rustdoc::rustdoc_only_bar_dependency
    rustdoc::rustdoc_same_name_documents_lib
    rustdoc::rustdoc_simple
    rustdoc::rustdoc_target
    rustdocflags::rerun
    rustflags::build_rustflags_with_home_config
    rustflags::cfg_rustflags_normal_source
    rustflags::cfg_rustflags_precedence
    rustflags::target_rustflags_string_and_array_form1
    rustflags::target_rustflags_string_and_array_form2
    rustflags::two_matching_in_config
    search::multiple_query_params
    search::not_update
    search::replace_default
    search::simple
    search::simple_with_host
    search::simple_with_index_and_host
    test::bad_example
    test::bin_does_not_rebuild_tests
    test::can_not_mix_doc_tests_and_regular_tests
    test::cargo_test_failing_test_in_bin
    test::cargo_test_failing_test_in_lib
    test::cargo_test_failing_test_in_test
    test::cargo_test_release
    test::cargo_test_simple
    test::cargo_test_verbose
    test::cfg_test_even_with_no_harness
    test::cyclic_dev_dep_doc_test
    test::doctest_feature
    test::doctest_skip_staticlib
    test::dylib_doctest
    test::example_bin_same_name
    test::example_with_dev_dep
    test::external_test_explicit
    test::external_test_implicit
    test::filter_no_doc_tests
    test::find_dependency_of_proc_macro_dependency_with_target
    test::lib_bin_same_name
    test::lib_with_standard_name
    test::lib_with_standard_name2
    test::lib_without_name
    test::only_test_docs
    test::pass_through_command_line
    test::publish_a_crate_without_tests
    test::selective_test_optional_dep
    test::selective_testing
    test::selective_testing_with_docs
    test::test_all_member_dependency_same_name
    test::test_all_targets_lib
    test::test_dep_with_dev
    test::test_dylib
    test::test_no_harness
    test::test_no_run
    test::test_run_implicit_bench_target
    test::test_run_implicit_bin_target
    test::test_run_implicit_test_target
    test::test_run_specific_bin_target
    test::test_run_specific_test_target
    test::test_then_build
    test::test_twice_with_build_cmd
    test::test_with_deep_lib_dep
    test::test_with_lib_dep
    tool_paths::absolute_tools
    tool_paths::pathless_tools
    tool_paths::relative_tools
    update::add_dep_deep_new_requirement
    update::conservative
    update::dry_run_update
    update::everything_real_deep
    update::minor_update_two_places
    update::transitive_minor_update
    update::update_precise
    update::update_via_new_dep
    update::update_via_new_member
    warn_on_failure::no_warning_on_bin_failure
    warn_on_failure::no_warning_on_success
    warn_on_failure::warning_on_lib_failure
    workspaces::cycle
    workspaces::dangling_member
    workspaces::dep_used_with_separate_features
    workspaces::fetch_fetches_all
    workspaces::glob_syntax_invalid_members
    workspaces::include_virtual
    workspaces::invalid_members
    workspaces::invalid_parent_pointer
    workspaces::lock_doesnt_change_depending_on_crate
    workspaces::lock_works_for_everyone
    workspaces::new_warns_you_this_will_not_work
    workspaces::parent_doesnt_point_to_child
    workspaces::relative_rustc
    workspaces::same_names_in_workspace
    workspaces::share_dependencies
    workspaces::two_roots
    workspaces::virtual_build_no_members
    workspaces::virtual_default_member_is_not_a_member
    workspaces::virtual_misconfigure
    workspaces::workspace_isnt_root
    workspaces::ws_rustc_err
    workspaces::you_cannot_generate_lockfile_for_empty_workspaces

Example logs from failed test cases:

failures:

---- alt_registry::depend_on_alt_registry_depends_on_crates_io stdout ----
running /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo build
thread 'main' panicked at '
Expected: execs
but: Did not find expected line:
[UPDATING] /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/registry index
Remaining available output:
Compiling bar v0.0.1 (registry /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/alternative-registry)
Compiling foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.95s
', src/tools/cargo/tests/testsuite/support/mod.rs:773:13
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.

---- alt_registry::depend_on_alt_registry_depends_on_same_registry stdout ----
running /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo build
thread 'main' panicked at '
Expected: execs
but: differences:
1 - |[DOWNLOADING] crates ...|
+ | Compiling bar v0.0.1 (registry /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/alternative-registry)|

2 - |[DOWNLOADED] [..] v0.0.1 (registry /[..])|
+ | Compiling foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)|

3 - |[DOWNLOADED] [..] v0.0.1 (registry /[..])|
+ | Finished dev [unoptimized + debuginfo] target(s) in 0.93s|

4 - |[COMPILING] baz v0.0.1 (registry /[..])|
+

5 - |[COMPILING] bar v0.0.1 (registry /[..])|
+

6 - |[COMPILING] foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)|
+

7 - |[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s|
+

other output:
``', src/tools/cargo/tests/testsuite/support/mod.rs:773:13

---- alt_registry::depend_on_alt_registry_depends_on_same_registry_no_index stdout ----
running /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo build
thread 'main' panicked at '
Expected: execs
but: differences:
1 - |[DOWNLOADING] crates ...|
+ | Compiling bar v0.0.1 (registry /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/alternative-registry)|

2 - |[DOWNLOADED] [..] v0.0.1 (registry /[..])|
+ | Compiling foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)|

3 - |[DOWNLOADED] [..] v0.0.1 (registry /[..])|
+ | Finished dev [unoptimized + debuginfo] target(s) in 0.91s|

4 - |[COMPILING] baz v0.0.1 (registry /[..])|
+

5 - |[COMPILING] bar v0.0.1 (registry /[..])|
+

6 - |[COMPILING] foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)|
+

7 - |[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s|
+

other output:
``', src/tools/cargo/tests/testsuite/support/mod.rs:773:13

---- alt_registry::no_api stdout ----
running /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo build
thread 'main' panicked at '
Expected: execs
but: differences:
1 - |[DOWNLOADING] crates ...|
+ | Compiling bar v0.0.1 (registry /tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/alternative-registry)|

2 - |[DOWNLOADED] bar v0.0.1 (registry /[..])|
+ | Compiling foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)|

3 - |[COMPILING] bar v0.0.1 (registry /[..])|
+ | Finished dev [unoptimized + debuginfo] target(s) in 0.57s|

4 - |[COMPILING] foo v0.0.1 (/tmp/guix-build-rust-1.33.0.drv-0/rustc-1.33.0-src/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t0/foo)|
+

5 - |[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]s|
+

other output:
``', src/tools/cargo/tests/testsuite/support/mod.rs:773:13

@ehuss
Copy link
Contributor

ehuss commented Mar 14, 2019

I'm having trouble reproducing the issue. The errors look very confusing, as if the libtest threads are getting mixed up.

One long-shot question, which version of cargo-vendor do you have installed? I believe the install script only checks that it is installed, but it doesn't verify the version. Does it work properly if vendoring is turned off?

@ipetkov
Copy link
Author

ipetkov commented Mar 14, 2019

@ehuss

Does it work properly if vendoring is turned off?

Interestingly enough I reproduced the same issue even with vendoring off (I had assumed the unvendored version should have passed the tests if it got released! Also I had noticed the path prefix matched that in the .cargo/config vendor value, but on closer inspection the tests simply show the parent directory which happens to include the vendor directory)

Here are the exact steps I ran (both with and without vendoring in two separate directories, on macOS):

#!/bin/bash
set -x

curl -LO https://static.rust-lang.org/dist/rustc-1.33.0-src.tar.gz
tar xzf rustc-1.33.0-src.tar.gz
cd rustc-1.33.0-src
./configure # Can also replace this by ./configure --enable-vendor
./x.py build -j1 src/tools/cargo
./x.py test -j1 -vv src/tools/cargo --no-fail-fast

@ipetkov
Copy link
Author

ipetkov commented Mar 14, 2019

@ehuss

The errors look very confusing, as if the libtest threads are getting mixed up.

I think you're spot on, I had a bit of insight from rust-lang/rust#59122, which turns out the issue is from running the tests with a single core (not sure if the issues are related, running on multiple cores passes the test!)

./x.py test -vv -j1 src/tools/cargo # fails
./x.py test -vv src/tools/cargo # passes

@ipetkov ipetkov changed the title Test suite fails when vendoring enabled in parent directory Test suite fails when run with a single core Mar 14, 2019
@ehuss
Copy link
Contributor

ehuss commented Mar 14, 2019

It is probably due to rust-lang/rust#56243. I'll try to look at it more later today.

@ehuss
Copy link
Contributor

ehuss commented Apr 4, 2019

There is more discussion of this at rust-lang/rust#58907, along with some workarounds. Unfortunately fixing Cargo's testsuite to support a single thread would be very difficult. It uses TLS to do test setup, and changing that would require updating almost every test. Maybe some day in the future there will be a test framework that supports setup/teardown, which might make this easier to address.

@Goirad
Copy link
Contributor

Goirad commented May 2, 2019

One of the problems is in tests/testsuite/support/paths.rs, the TASK_ID is assumed to be different for every single test, but this is not always the case, for example when running with RUST_TEST_THREADS=1.

@jethrogb
Copy link
Contributor

jethrogb commented May 2, 2019

PR: #6900

bors added a commit that referenced this issue Jun 7, 2019
Fix nonconcurrent tests

The cargo testsuite relies on a clean test “root” for every test (i.e. `#[test]`-annotated function). It relied on the `test` crate's behavior to spawn a new thread for each test, which isn't done when tests aren't run concurrently, breaking the test suite. In this PR, I'm using backtraces to figure out which test is being run, which is much more robust. I also cleaned up the root initialization logic so that it no longer recursive calls the `init` function.

Fixes #6746
@bors bors closed this as completed in #6900 Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing-cargo-itself Area: cargo's tests C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants