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

fix: repair flaking test job of setup e2e test environment #3682

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

chaosi-zju
Copy link
Member

@chaosi-zju chaosi-zju commented Jun 19, 2023

What type of PR is this?

/kind flake

What this PR does / why we need it:

for CI stability

Which issue(s) this PR fixes:

Fixes #3667

Special notes for your reviewer:
@RainbowMango @XiShanYongYe-Chang @yike21

Does this PR introduce a user-facing change?:


@karmada-bot karmada-bot added the kind/flake Categorizes issue or PR as related to a flaky test. label Jun 19, 2023
@karmada-bot
Copy link
Collaborator

Welcome @chaosi-zju! It looks like this is your first PR to karmada-io/karmada 🎉

@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 19, 2023
@yike21
Copy link
Member

yike21 commented Jun 19, 2023

Hi! @chaosi-zju Glad to see your contribution! Usually please use git commit -s -m 'your message ' or git commit -m ' Signed-off-by: AuthorName <authoremail@example.com> \n <other message> ' to pass DCO. And rebase to the latest codebase before committing is appreciated.

# an example
# in branch `fake-ci`
git fetch upstream
git rebase upstream/master
git commit -s --amend
git push -f

Signed-off-by: chaosi-zju <chaosi@zju.edu.cn>
@chaosi-zju
Copy link
Member Author

Hi! @chaosi-zju Glad to see your contribution! Usually please use git commit -s -m 'your message ' or git commit -m ' Signed-off-by: AuthorName <authoremail@example.com> \n <other message> ' to pass DCO. And rebase to the latest codebase before committing is appreciated.

# an example
# in branch `fake-ci`
git fetch upstream
git rebase upstream/master
git commit -s --amend
git push -f

thank you very much~

@codecov-commenter
Copy link

Codecov Report

Merging #3682 (c140480) into master (76acb6d) will increase coverage by 0.01%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #3682      +/-   ##
==========================================
+ Coverage   56.63%   56.64%   +0.01%     
==========================================
  Files         221      221              
  Lines       20838    20834       -4     
==========================================
+ Hits        11801    11802       +1     
+ Misses       8415     8409       -6     
- Partials      622      623       +1     
Flag Coverage Δ
unittests 56.64% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 6 files with indirect coverage changes

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

Generally looks good to me.
@yike21 do you have any other comments?

Comment on lines +445 to +446
rm -f "${main_config}"
rm -f "${member_config}"
Copy link
Member

Choose a reason for hiding this comment

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

It just feels a little bit rough to delete the entire kubeconfig file.
If the file contains a cluster not created by kind, the configuration will be removed unexpectedly.

It's not a big deal though.

Copy link
Member

Choose a reason for hiding this comment

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

Generally LGTM. It seems that the logic for removing kubeconfig is included here. And the logic for removing kind clusters scope is expanded.

I think it's more suitable to just delete kind clusters which created by local-up-karmada.sh.

Copy link
Member Author

@chaosi-zju chaosi-zju Jun 20, 2023

Choose a reason for hiding this comment

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

It just feels a little bit rough to delete the entire kubeconfig file. If the file contains a cluster not created by kind, the configuration will be removed unexpectedly.

It's not a big deal though.

Although kind delete is capable of cleaning kubeconfig if specificed $KUBECONFIG or --kubeconfig, it is not as effective as expected. I have tried these two modification method:

  1. one
export KUBECONFIG="${main_config}":"${member_config}"
kind delete clusters --all >> "${log_file}" 2>&1
unset KUBECONFIG
  1. two
kind delete clusters --kubeconfig "${main_config}" karmada-host
kind delete clusters --kubeconfig "${member_config}" member1 member2 member3

All above methods can not clean up kubeconfig content thoroughly.

So, I currently have no more elegant way to clean up kubeconfig.


By the way, even if no rm -f xxx_config in delete_all_clusters, following the original logic, the script will eventually execute rm -f xxx_config in util::create_cluster.

the code of util::create_cluster:

function util::create_cluster() {
  local cluster_name=${1}
  local kubeconfig=${2}
  local kind_image=${3}
  local log_path=${4}
  local cluster_config=${5:-}

  mkdir -p ${log_path}
  rm -rf "${log_path}/${cluster_name}.log"
  rm -f "${kubeconfig}"
  ...
}

Copy link
Member

Choose a reason for hiding this comment

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

OK. got it.

@yike21
Copy link
Member

yike21 commented Jun 20, 2023

LGTM, thanks for your work!

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 20, 2023
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 20, 2023
@karmada-bot karmada-bot merged commit 9bac51d into karmada-io:master Jun 20, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/flake Categorizes issue or PR as related to a flaky test. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaking test: setup e2e test environment
5 participants