From ae111475a0dfc2f4d0edc9d531944fdcbf2015f9 Mon Sep 17 00:00:00 2001 From: Xumin <100666470+StarlightIbuki@users.noreply.github.com> Date: Mon, 20 May 2024 17:17:48 +0800 Subject: [PATCH] tests(core): fix flakiness due to migration error (#13049) Fix KAG-4526 --- spec/02-integration/04-admin_api/17-foreign-entity_spec.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/02-integration/04-admin_api/17-foreign-entity_spec.lua b/spec/02-integration/04-admin_api/17-foreign-entity_spec.lua index 0c588774f152..afb94cfe24ac 100644 --- a/spec/02-integration/04-admin_api/17-foreign-entity_spec.lua +++ b/spec/02-integration/04-admin_api/17-foreign-entity_spec.lua @@ -30,10 +30,14 @@ for _, strategy in helpers.each_strategy() do [[./spec/fixtures/custom_plugins/?.lua;]].. [[./spec/fixtures/custom_plugins/?/init.lua;" ]] + -- bootstrap db in case it's not done yet + -- ignore errors if it's already bootstrapped + helpers.kong_exec("migrations bootstrap -c " .. helpers.test_conf_path, env, true, lua_path) + local cmdline = "migrations up -c " .. helpers.test_conf_path local _, code, _, stderr = helpers.kong_exec(cmdline, env, true, lua_path) - assert.same(0, code) assert.equal("", stderr) + assert.same(0, code) local _ _, db = helpers.get_db_utils(strategy, {