From c3bfcd3b4cbe8b364a9c69c149e966d61cb732b6 Mon Sep 17 00:00:00 2001 From: Ayato Tokubi Date: Sat, 4 May 2024 14:35:07 +0000 Subject: [PATCH] wait for reload completion for stable e2e Signed-off-by: Ayato Tokubi --- contrib/test/ci/integration.yml | 1 - contrib/test/ci/vars.yml | 4 ---- server/server.go | 1 + test/reload_config.bats | 3 +++ 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/test/ci/integration.yml b/contrib/test/ci/integration.yml index cec1978995d..2b7e6d242a3 100644 --- a/contrib/test/ci/integration.yml +++ b/contrib/test/ci/integration.yml @@ -54,7 +54,6 @@ state: present loop: "{{ ['cgroups.bats'] | product(kata_skip_cgroups_tests) \ + ['command.bats'] | product(kata_skip_command_tests) \ - + ['reload_config.bats'] | product(kata_skip_reload_config_tests) \ + ['config.bats'] | product(kata_skip_config_tests) \ + ['config_migrate.bats'] | product(kata_skip_config_migrate_tests) \ + ['crio-wipe.bats'] | product(kata_skip_crio_wipe_tests) \ diff --git a/contrib/test/ci/vars.yml b/contrib/test/ci/vars.yml index d0ef4061865..d9f5ac1fe14 100644 --- a/contrib/test/ci/vars.yml +++ b/contrib/test/ci/vars.yml @@ -99,10 +99,6 @@ kata_skip_cgroups_tests: kata_skip_command_tests: - 'test "crio commands"' - 'test "log max boundary testing"' -kata_skip_reload_config_tests: - - "test \"reload config should update 'pinned_images'\"" - - "test \"reload config should update 'pinned_images' and only 'pause_image' is pinned\"" - - "test \"reload config should update 'pause_image' and it becomes 'pinned_images'\"" kata_skip_config_tests: - 'test "choose different default runtime should succeed"' - 'test "runc not existing when default_runtime changed should succeed"' diff --git a/server/server.go b/server/server.go index 0ac893868db..ca7ba81cbce 100644 --- a/server/server.go +++ b/server/server.go @@ -583,6 +583,7 @@ func (s *Server) startReloadWatcher(ctx context.Context) { // ImageServer compiles the list with regex for both // pinned and sandbox/pause images, we need to update them s.StorageImageServer().UpdatePinnedImagesList(append(s.config.PinnedImages, s.config.PauseImage)) + logrus.Info("Configuration reload completed") } }() diff --git a/test/reload_config.bats b/test/reload_config.bats index 19ce1e26ba6..fb3f6d7d819 100644 --- a/test/reload_config.bats +++ b/test/reload_config.bats @@ -243,6 +243,7 @@ EOF reload_crio # image becomes pinned expect_log_success $OPTION $EXAMPLE_IMAGE + wait_for_log "Configuration reload completed" output=$(crictl images -o json | jq ".images[] | select(.repoTags[] == \"$EXAMPLE_IMAGE\") |.pinned") [ "$output" == "true" ] } @@ -251,6 +252,7 @@ EOF OPTION="pause_image" printf '[crio.image]\npinned_images = [""]\n' > "$CRIO_CONFIG_DIR"/00-default reload_crio + wait_for_log "Configuration reload completed" output=$(crictl images -o json | jq '.images[] | select(.pinned == true) | .repoTags[]') # only pause image is pinned [[ "$output" == *"pause"* ]] @@ -262,6 +264,7 @@ EOF printf '[crio.image]\npinned_images = [""]\npause_image = "%s"\n' $EXAMPLE_IMAGE > "$CRIO_CONFIG_DIR"/04-overwrite reload_crio expect_log_success $OPTION $EXAMPLE_IMAGE + wait_for_log "Configuration reload completed" output=$(crictl images -o json | jq '.images[] | select(.pinned == true) | .repoTags[]') # pause image is pinned [[ "$output" == *"fedora-crio-ci"* ]]