Skip to content

Commit

Permalink
fix where frankenphp configuration was bleeding into later tests
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Sep 8, 2024
1 parent 0465afc commit 1bd99bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion caddy/caddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ func (f *FrankenPHPApp) Start() error {
return nil
}

func (*FrankenPHPApp) Stop() error {
func (f *FrankenPHPApp) Stop() error {
caddy.Log().Info("FrankenPHP stopped 🐘")
// reset configuration so it doesn't bleed into later tests
f.Workers = nil
f.NumThreads = 0

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion caddy/caddy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ func TestMetrics(t *testing.T) {
# HELP frankenphp_busy_threads Number of busy PHP threads
# TYPE frankenphp_busy_threads gauge
frankenphp_busy_threads 1
frankenphp_busy_threads 0
`

require.NoError(t, testutil.GatherAndCompare(prometheus.DefaultGatherer, strings.NewReader(expectedMetrics), "frankenphp_total_threads", "frankenphp_busy_threads"))
Expand Down

0 comments on commit 1bd99bb

Please sign in to comment.