test_cluster_pool.go ×8

Frontier kind: Code frontier

unlabeled · c_7e16692941c6

18 tests · 2952 LOC · 153 files · introduces 0 tests · 44 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges44 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
431 ranges2952 lines · 153 files · Browse complete extent
All tests (intent)
18 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.

3 files ranked by introduced lines: 44 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/tests/testcore/test_cluster_pool.go 33 introduced LOC · 8 ranges

Open complete file

16 var testClusterRouter *clusterRouter
17
18 > func init() { test_cluster_pool.go
19 > sharedSize := max(1, runtime.GOMAXPROCS(0)/2)
20 > if v := os.Getenv("TEMPORAL_TEST_SHARED_CLUSTERS"); v != "" {
21 n, err := strconv.Atoi(v)
22 if err != nil || n <= 0 {
26 }
27
28 > dedicatedSize := runtime.GOMAXPROCS(0) test_cluster_pool.go
29 > if v := os.Getenv("TEMPORAL_TEST_DEDICATED_CLUSTERS"); v != "" {
30 n, err := strconv.Atoi(v)
31 if err != nil || n <= 0 {
37 // In CI, recreate clusters after 50 tests to prevent resource accumulation.
38 // Locally, clusters are reused indefinitely for faster iteration.
39 > var maxLeases int test_cluster_pool.go
40 > if os.Getenv("CI") != "" {
41 maxLeases = 50
42 }
43
44 > var eventsFile *os.File test_cluster_pool.go
45 > if path := os.Getenv("TEMPORAL_TEST_CLUSTER_EVENTS_FILE"); path != "" {
46 > f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
47 > if err != nil {
48 log.Printf("cluster events disabled: cannot open %q: %v", path, err)
49 }
50 > eventsFile = f test_cluster_pool.go
51 }
52
53 > testClusterRouter = &clusterRouter{ test_cluster_pool.go
54 > shared: newClusterPool(sharedSize, false, maxLeases),
55 > dedicated: newClusterPool(dedicatedSize, true, maxLeases),
56 > eventsFile: eventsFile,
57 > }
58 }
59
76 }
77
78 > func newClusterPool(size int, exclusive bool, maxLeases int) *clusterPool { test_cluster_pool.go
79 > p := &clusterPool{
80 > allSlots: make([]*clusterPoolSlot, size),
81 > }
82 > for i := range size {
83 > p.allSlots[i] = &clusterPoolSlot{
84 > idx: i,
85 > maxLeases: maxLeases,
86 > }
87 > }
88 > if exclusive {
89 > p.availableSlots = make(chan *clusterPoolSlot, size)
90 > for _, slot := range p.allSlots {
91 > p.availableSlots <- slot
92 > }
93 }
94 > return p test_cluster_pool.go
95 }
96
go.temporal.io/server/tests/testcore/functional_test_base.go 6 introduced LOC · 1 range

Open complete file

108 )
109
110 > func init() { functional_test_base.go
111 > // By default, the SDK worker will calculate a checksum of the binary and use that as an identifier.
112 > // But given the size of the test binary, that has a significant performance impact (100 ms or more).
113 > // By specifying a checksum here, we can avoid that overhead.
114 > sdkworker.SetBinaryChecksum("oss-server-test")
115 > }
116
117 func WithDCRedirectionPolicy(policy config.DCRedirectionPolicy) TestClusterOption {
go.temporal.io/server/tests/testcore/flag.go 5 introduced LOC · 1 range

Open complete file

17 }
18
19 > func init() { flag.go
20 > flag.StringVar(&cliFlags.persistenceType, "persistenceType", "sql", "type of persistence - [nosql or sql]")
21 > flag.StringVar(&cliFlags.persistenceDriver, "persistenceDriver", "sqlite", "driver of nosql/sql - [cassandra, mysql8, postgres12, sqlite]")
22 > flag.StringVar(&cliFlags.enableFaultInjection, "enableFaultInjection", "", "enable global fault injection")
23 > }
24
25 func UseSQLVisibility() bool {