Skip to content

Commit

Permalink
Merge pull request cri-o#7019 from haircommander/timeout-metric-test-fix
Browse files Browse the repository at this point in the history
test: fix timeout metric test
  • Loading branch information
openshift-merge-robot committed Jun 9, 2023
2 parents 19819c4 + d58f408 commit 6b1201c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/timeout.bats
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ function wait_clean() {

run ! crictl runp -T "$CANCEL_TIMEOUT" "$TESTDATA"/sandbox_config.json

# allow metric to be populated
METRIC=$(curl -sf "http://localhost:$PORT/metrics" | grep 'crio_resources_stalled_at_stage{')
[[ "$METRIC" == 'container_runtime_crio_resources_stalled_at_stage{stage="sandbox container runtime creation"} 1' ]]
# the test races against itself, so we don't know the exact stage that will be registered. It should be one of them.
[[ "$METRIC" == 'container_runtime_crio_resources_stalled_at_stage{stage="sandbox '* ]]
}

@test "should not clean up container after timeout" {
Expand Down Expand Up @@ -232,8 +234,10 @@ function wait_clean() {

run ! crictl create -T "$CANCEL_TIMEOUT" "$pod_id" "$TESTDATA"/container_config.json "$TESTDATA"/sandbox_config.json

# allow metric to be populated
METRIC=$(curl -sf "http://localhost:$PORT/metrics" | grep 'crio_resources_stalled_at_stage{')
[[ "$METRIC" == 'container_runtime_crio_resources_stalled_at_stage{stage="container runtime creation"} 1' ]]
# the test races against itself, so we don't know the exact stage that will be registered. It should be one of them.
[[ "$METRIC" == 'container_runtime_crio_resources_stalled_at_stage{stage="container '* ]]
}

# this test case is paranoid, but mostly checks that we can't
Expand Down

0 comments on commit 6b1201c

Please sign in to comment.