Home / Function/ TestRunWithPort() — gin Function Reference

TestRunWithPort() — gin Function Reference

Architecture documentation for the TestRunWithPort() function in gin_integration_test.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  85d05d41_699f_c2fc_da73_6d7af7ead393["TestRunWithPort()"]
  0cb54875_e9be_d799_8e29_6666cf3d9cd7["testRequest()"]
  85d05d41_699f_c2fc_da73_6d7af7ead393 -->|calls| 0cb54875_e9be_d799_8e29_6666cf3d9cd7
  style 85d05d41_699f_c2fc_da73_6d7af7ead393 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

gin_integration_test.go lines 233–246

func TestRunWithPort(t *testing.T) {
	router := New()
	go func() {
		router.GET("/example", func(c *Context) { c.String(http.StatusOK, "it worked") })
		assert.NoError(t, router.Run(":5150"))
	}()

	// Wait for server to be ready with exponential backoff
	err := waitForServerReady("http://localhost:5150/example", 10)
	require.NoError(t, err, "server should start successfully")

	require.Error(t, router.Run(":5150"))
	testRequest(t, "http://localhost:5150/example")
}

Domain

Subdomains

Frequently Asked Questions

What does TestRunWithPort() do?
TestRunWithPort() is a function in the gin codebase.
What does TestRunWithPort() call?
TestRunWithPort() calls 1 function(s): testRequest.

Analyze Your Own Codebase

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

Try Supermodel Free