Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@haircommander
Copy link
Member

/kind flake

What this PR does / why we need it:

cherry-pick of #4141 and #4064 to fix stats flakes and bad error messages

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

none

kolyshkin and others added 6 commits September 2, 2020 09:42
1. Ensure that stats are shown for the particular ID.

2. Simplify json checks:
   - use "here file" instead of echo and pipe
   - remove intermediate variable
   - remove useless run and status checks (set -e is sufficient

Signed-off-by: Kir Kolyshkin <[email protected]>
As pointed out by shellcheck:

> In test/stats.bats line 72:
>     run crictl stats -o json "$crt2_id"
>                               ^------^ SC2154: crt2_id is referenced but not assigned.

The test works just fine though, because

 1. it is the same as running crictl stats without ID, in which case it
    shows stats for all IDs.

 2. the values obtained are not compared in any way, just printed.

Signed-off-by: Kir Kolyshkin <[email protected]>
1. Make sure we actually compare the memory usage, rather than merely
   printing it. Add a comment describing what we're doing here.

2. Use "here file" instead of echo.

3. Make sure stats are provided for the given id.

4. Consolidate getting memory usage so there are less temp variables.

5. When possible, use

	var=$(cmd ... 2>&1)
	echo "$var"

   instead of

	run cmd ...
	[ "$status" -eq 0 ]
	echo "$output"
	var="$output"

   They are roughly the same, and `set -e` (set by bats) implicitly
   checks the exit code. The `2>&1` stance is needed to see the error

Signed-off-by: Kir Kolyshkin <[email protected]>
container_redis.json seems to intermittantly exit, which makes using it
as the basis for comparison for stats tretcherous.

Signed-off-by: Peter Hunt <[email protected]>
it is much less likely two containers will use the same amount of memory if they're different containers

Signed-off-by: Peter Hunt <[email protected]>
as it can be unmounted multiple times and should not result in an error

Signed-off-by: Peter Hunt <[email protected]>
@openshift-ci-robot openshift-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/flake Categorizes issue or PR as related to a flaky test. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Sep 2, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 2, 2020
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, mrunalp

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [haircommander,mrunalp]

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

@mrunalp
Copy link
Member

mrunalp commented Sep 2, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 2, 2020
@codecov
Copy link

codecov bot commented Sep 2, 2020

Codecov Report

Merging #4153 into release-1.19 will not change coverage.
The diff coverage is 0.00%.

@@              Coverage Diff              @@
##           release-1.19    #4153   +/-   ##
=============================================
  Coverage         41.58%   41.58%           
=============================================
  Files               110      110           
  Lines              9046     9046           
=============================================
  Hits               3762     3762           
  Misses             4944     4944           
  Partials            340      340           

@openshift-ci-robot
Copy link

openshift-ci-robot commented Sep 2, 2020

@haircommander: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 e518ffc link /test e2e_cgroupv2

Full PR test history. Your PR dashboard.

Details

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 kubernetes/test-infra repository. I understand the commands that are listed here.

@haircommander
Copy link
Member Author

/test e2e-aws

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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/flake Categorizes issue or PR as related to a flaky test. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants