CreateServer creates a server with the given database, returning a connection to the server. The server will close when the connection is closed (or loses its connection to the server). The accompanying [svcs.Controller] may be used to wait until the server has closed.
(t *testing.T, database string)
| 401 | // when the connection is closed (or loses its connection to the server). The accompanying [svcs.Controller] may be used |
| 402 | // to wait until the server has closed. |
| 403 | func CreateServer(t *testing.T, database string) (context.Context, *Connection, *svcs.Controller) { |
| 404 | port, err := sql.GetEmptyPort() |
| 405 | require.NoError(t, err) |
| 406 | return CreateServerWithPort(t, database, port) |
| 407 | } |
| 408 | |
| 409 | // CreateServerWithPort creates a server with the given database and port, returning a connection to the server. The server will close |
| 410 | // when the connection is closed (or loses its connection to the server). The accompanying [svcs.Controller] may be used |