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

tests: ignore env var dependent tests at runtime #12805

Merged
merged 10 commits into from Jun 15, 2022

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Jun 13, 2022

Signed-off-by: tabokie xy.tao@outlook.com

What is changed and how it works?

Issue Number: Close #12804

What's Changed:

Implement rust-lang/rust#68007 using custom test runner.

The test runner is deliberately not placed in test_util crate to avoid dependency.

Also bump rust-toolchain to 2022-05-01 to use ignore message (rust-lang/cargo#10250, rust-lang/rust#96132). We can implement similar functionality by parsing test name, but that will be slower and not very UI friendly.

The only reason I still keep two lines in test script is to avoid repeated <jemalloc>: Invalid conf pair: prof:true yelling during build.

Related changes

Check List

Tests

  • Unit test

Manual test:

# cargo test --features mem-profiling --features jemalloc -p tikv_alloc ifdef_malloc_conf
test imp::profiling::tests::test_profiling_memory_ifdef_malloc_conf ... ignored, #ifdef MALLOC_CONF
# MALLOC_CONF=prof:true cargo test --features mem-profiling --features jemalloc -p tikv_alloc ifdef_malloc_conf
test imp::profiling::tests::test_profiling_memory_ifdef_malloc_conf ... ok

Release note

None

Signed-off-by: tabokie <xy.tao@outlook.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jun 13, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Connor1996
  • sticnarf

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@ti-chi-bot ti-chi-bot added size/L and removed size/M labels Jun 13, 2022
Signed-off-by: tabokie <xy.tao@outlook.com>
Copy link
Contributor

@sticnarf sticnarf left a comment

Choose a reason for hiding this comment

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

Do you know why CI fails because tikv-ctl depends on libstdc++?

components/tikv_alloc/src/lib.rs Outdated Show resolved Hide resolved
@tabokie
Copy link
Member Author

tabokie commented Jun 14, 2022

Do you know why CI fails because tikv-ctl depends on libstdc++?

I do not. Upstream reports rust-lang/rust#94983 but it didn't fix our issue. I'm trying to reproduce it in a smaller repo and bisect the cause.

The regression is caused by rust-lang/rust#93901. Fixed by manually adding that flag back.

Signed-off-by: tabokie <xy.tao@outlook.com>
Signed-off-by: tabokie <xy.tao@outlook.com>
@@ -32,7 +32,7 @@ fn link_sys_lib(lib: &str, tool: &cc::Tool) {
}
// remove lib prefix and .a postfix.
let libname = &lib[3..lib.len() - 2];
println!("cargo:rustc-link-lib=static={}", &libname);
println!("cargo:rustc-link-lib=static:+whole-archive={}", &libname);
Copy link
Member

Choose a reason for hiding this comment

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

what's this

Copy link
Member Author

Choose a reason for hiding this comment

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

From what I can read, whole-archive flag will force using static symbols when there're both a static and a dynamic version available. It is enabled by default before. The fact that we must enable it to pass the check means we somehow linked multiple versions of libstdc++.

Copy link
Member

Choose a reason for hiding this comment

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

How can that happen? I think it should report duplicated symbol error.

Copy link
Member Author

@tabokie tabokie Jun 15, 2022

Choose a reason for hiding this comment

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

I meant to say that multiple versions are available for the linker. So it's up to the implementation to choose one of them. And FYI during the debugging I have ruled out rust-rocksdb by setting the static_libcpp feature.

Copy link
Contributor

@sticnarf sticnarf left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Status: PR - There is already 1 approval label Jun 15, 2022
@@ -1 +1 @@
nightly-2022-02-14
nightly-2022-05-01
Copy link
Member

Choose a reason for hiding this comment

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

Why use 05-01?

Copy link
Member Author

Choose a reason for hiding this comment

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

rust-lang/rust#96132 is fixed in 04-17.

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot removed the status/LGT1 Status: PR - There is already 1 approval label Jun 15, 2022
@ti-chi-bot ti-chi-bot added the status/LGT2 Status: PR - There are already 2 approvals label Jun 15, 2022
@tabokie
Copy link
Member Author

tabokie commented Jun 15, 2022

/merge

@ti-chi-bot
Copy link
Member

@tabokie: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 68b2dfa

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Jun 15, 2022
Signed-off-by: tabokie <xy.tao@outlook.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Status: Can merge to base branch label Jun 15, 2022
@tabokie
Copy link
Member Author

tabokie commented Jun 15, 2022

/merge

@ti-chi-bot
Copy link
Member

@tabokie: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 39d35f3

@ti-chi-bot ti-chi-bot added the status/can-merge Status: Can merge to base branch label Jun 15, 2022
@ti-chi-bot ti-chi-bot merged commit 2fbf7ee into tikv:master Jun 15, 2022
@tabokie tabokie deleted the optional-test branch June 15, 2022 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none size/L status/can-merge Status: Can merge to base branch status/LGT2 Status: PR - There are already 2 approvals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

all ignored tests are run in make test
5 participants