Home / Function/ Test_HTTPHandler_App_Test_Interrupted() — fiber Function Reference

Test_HTTPHandler_App_Test_Interrupted() — fiber Function Reference

Architecture documentation for the Test_HTTPHandler_App_Test_Interrupted() function in adapter_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  b2bc46b5_1db0_ea20_c94a_903cca45ea90["Test_HTTPHandler_App_Test_Interrupted()"]
  3ad7a4ef_7f07_008c_234d_52c9a342aa98["adapter_test.go"]
  b2bc46b5_1db0_ea20_c94a_903cca45ea90 -->|defined in| 3ad7a4ef_7f07_008c_234d_52c9a342aa98
  style b2bc46b5_1db0_ea20_c94a_903cca45ea90 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

adapter_test.go lines 721–745

func Test_HTTPHandler_App_Test_Interrupted(t *testing.T) {
	t.Parallel()

	app := New()

	app.Get("/", func(w http.ResponseWriter, _ *http.Request) {
		flusher, ok := w.(http.Flusher)
		if !ok {
			t.Fatal("w does not implement http.Flusher")
		}
		w.WriteHeader(StatusOK)
		fmt.Fprintf(w, "Hello ")
		flusher.Flush()
		time.Sleep(500 * time.Millisecond)
		fmt.Fprintf(w, "World!")
	})

	resp, err := app.Test(httptest.NewRequest(MethodGet, "/", http.NoBody), TestConfig{
		Timeout:       200 * time.Millisecond,
		FailOnTimeout: true, // Changed to true to test interrupted behavior
	})
	// With FailOnTimeout: true, we should get a timeout error
	require.ErrorIs(t, err, os.ErrDeadlineExceeded)
	require.Nil(t, resp)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_HTTPHandler_App_Test_Interrupted() do?
Test_HTTPHandler_App_Test_Interrupted() is a function in the fiber codebase, defined in adapter_test.go.
Where is Test_HTTPHandler_App_Test_Interrupted() defined?
Test_HTTPHandler_App_Test_Interrupted() is defined in adapter_test.go at line 721.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free