From 7f7beded8018a31034e7c70cfa2107908a272fb5 Mon Sep 17 00:00:00 2001 From: Mindaugas Rukas <3825716+mindaugasrukas@users.noreply.github.com> Date: Wed, 13 Apr 2022 07:25:17 -0700 Subject: [PATCH] Fix flaky tests. Use jq to sort JSON arrays before comparing them. (#2007) --- testing/e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/e2e.sh b/testing/e2e.sh index ea62c4112..f8f58ff55 100755 --- a/testing/e2e.sh +++ b/testing/e2e.sh @@ -148,7 +148,7 @@ function test_new_container_push_skip_unchanged_digest_changed() { cid=$(docker run --rm -d -p 5000:5000 --name registry registry:2) EXPECT_CONTAINS "$(bazel run @io_bazel_rules_docker//tests/container:new_push_test_skip_unchanged_digest_changed_tag_1 2>&1)" "Successfully pushed Docker image" EXPECT_CONTAINS "$(bazel run @io_bazel_rules_docker//tests/container:new_push_test_skip_unchanged_digest_changed_tag_2 2>&1)" "Successfully pushed Docker image" - EXPECT_CONTAINS "$(curl localhost:5000/v2/docker/test/tags/list)" '{"name":"docker/test","tags":["changed_tag1","changed_tag2"]}' + EXPECT_CONTAINS "$(curl -s localhost:5000/v2/docker/test/tags/list | jq --sort-keys -c '(.. | arrays) |= sort')" '{"name":"docker/test","tags":["changed_tag1","changed_tag2"]}' } function test_new_container_push_compat() {