-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[1.19] fix stats test and fix Unmount error #4153
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
[1.19] fix stats test and fix Unmount error #4153
Conversation
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]>
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
Codecov Report
@@ 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 |
|
@haircommander: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/test e2e-aws |
/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?