MCPcopy
hub / github.com/gofiber/fiber / Test_Hook_OnHook

Function Test_Hook_OnHook

hooks_test.go:546–563  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

544}
545
546func Test_Hook_OnHook(t *testing.T) {
547 app := New()
548
549 enableTestPreforkMaster(t)
550 enableTestOnPrefork(t)
551
552 app.Hooks().OnFork(func(pid int) error {
553 require.Equal(t, 1, pid)
554 return nil
555 })
556
557 err := app.prefork(":0", nil, &ListenConfig{
558 DisableStartupMessage: true,
559 EnablePrefork: true,
560 PreforkRecoverThreshold: 1,
561 })
562 require.ErrorIs(t, err, prefork.ErrOverRecovery)
563}
564
565func Test_Hook_OnMount(t *testing.T) {
566 t.Parallel()

Callers

nothing calls this directly

Calls 6

enableTestPreforkMasterFunction · 0.85
enableTestOnPreforkFunction · 0.85
OnForkMethod · 0.80
HooksMethod · 0.80
preforkMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected