server.go ×4

Frontier kind: Code frontier

unlabeled · c_1688150c05dd

44 tests · 2449 LOC · 123 files · introduces 0 tests · 31 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges31 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
373 ranges2449 lines · 123 files · Browse complete extent
All tests (intent)
44 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 31 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/common/nexus/nexustest/server.go 29 introduced LOC · 4 ranges

Open complete file

15 )
16
17 > func AllocListenAddress() string { server.go
18 > return fmt.Sprintf("localhost:%d", freeport.MustGetFreePort())
19 > }
20
21 > func NewNexusServer(t *testing.T, listenAddr string, handler nexus.Handler) { server.go
22 > // Create listener
23 > listener, err := net.Listen("tcp", listenAddr)
24 > require.NoError(t, err, "Nexus test server failed to listen on %s", listenAddr)
25 >
26 > // Create HTTP handler and server
27 > hh := nexusrpc.NewHTTPHandler(nexusrpc.HandlerOptions{
28 > Handler: handler,
29 > })
30 > srv := &http.Server{Addr: listenAddr, Handler: hh}
31 >
32 > // Start server
33 > errCh := make(chan error, 1)
34 > go func() {
35 > errCh <- srv.Serve(listener)
36 > }()
37
38 > t.Cleanup(func() { server.go
39 > ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
40 > defer cancel()
41 >
42 > // Shutdown server gracefully
43 > err = srv.Shutdown(ctx)
44 > if err != nil {
45 // Graceful shutdown failed, force close
46 require.ErrorIs(t, err, context.DeadlineExceeded, "Nexus test server graceful shutdown failed")
49
50 // Wait for server to exit gracefully
51 > select { server.go
52 > case err := <-errCh:
53 > require.ErrorIs(t, err, http.ErrServerClosed, "Nexus test server Serve returned unexpected error")
54 case <-time.After(time.Second):
55 require.Fail(t, "Nexus test server Serve did not exit after shutdown")
go.temporal.io/server/common/nexus/nexusrpc/server.go 2 introduced LOC · 1 range

Open complete file

385 }
386 if options.GetResultTimeout == 0 {
387 > options.GetResultTimeout = time.Minute server.go
388 > }
389 if options.Serializer == nil {
390 options.Serializer = nexus.DefaultSerializer()