Skip to content

Commit

Permalink
tests(cmd): clean and prepare the prefix directory for each test case
Browse files Browse the repository at this point in the history
This ensures that the prefix directory is reset to a known state after
other test runs (and in between individual test cases), fixing a
flakiness issue we've been seeing in CI:

> FAIL spec/02-integration/02-cmd/06-restart_spec.lua:23: kong restart restarts if not running
> spec/02-integration/02-cmd/06-restart_spec.lua:26: Error: in-memory storage can not be used when role = "control_plane"
>
>  Run with --v (verbose) or --vv (debug) for more details
  • Loading branch information
flrgh committed Nov 15, 2024
1 parent 4059a31 commit 2c1a70f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/02-integration/02-cmd/06-restart_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ end
describe("kong restart", function()
lazy_setup(function()
helpers.get_db_utils(nil, {}) -- runs migrations
helpers.prepare_prefix()
end)
lazy_teardown(function()
helpers.clean_prefix()
end)
before_each(function()
helpers.clean_prefix()
helpers.prepare_prefix()
end)
after_each(function()
helpers.kill_all()
end)
Expand Down

0 comments on commit 2c1a70f

Please sign in to comment.