MCPcopy
hub / github.com/NVIDIA/aistore / RandomProxyURL

Function RandomProxyURL

devtools/tutils/node.go:88–116  ·  view source on GitHub ↗
(ts ...*testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func RandomProxyURL(ts ...*testing.T) (url string) {
89 var (
90 baseParams = BaseAPIParams(proxyURLReadOnly)
91 smap, err = waitForStartup(baseParams)
92 retries = 3
93 )
94 if err == nil {
95 return getRandomProxyURL(smap)
96 }
97 for _, node := range pmapReadOnly {
98 url := node.URL(cmn.NetPublic)
99 if url == proxyURLReadOnly {
100 continue
101 }
102 if retries == 0 {
103 return ""
104 }
105 baseParams = BaseAPIParams(url)
106 if smap, err = waitForStartup(baseParams); err == nil {
107 return getRandomProxyURL(smap)
108 }
109 retries--
110 }
111 if len(ts) > 0 {
112 tassert.CheckFatal(ts[0], err)
113 }
114
115 return ""
116}
117
118func getRandomProxyURL(smap *cluster.Smap) string {
119 proxies := smap.Pmap.ActiveNodes()

Callers 15

BenchmarkECEncodeFunction · 0.92
BenchmarkECRebalanceFunction · 0.92
BenchmarkRebalanceFunction · 0.92
TestRegressionBucketsFunction · 0.92
TestRenameBucketFunction · 0.92
TestRenameObjectsFunction · 0.92
TestObjectPrefixFunction · 0.92
TestGetNodeStatsFunction · 0.92
TestGetClusterStatsFunction · 0.92

Calls 5

CheckFatalFunction · 0.92
BaseAPIParamsFunction · 0.85
waitForStartupFunction · 0.85
getRandomProxyURLFunction · 0.85
URLMethod · 0.45

Tested by 15

BenchmarkECEncodeFunction · 0.74
BenchmarkECRebalanceFunction · 0.74
BenchmarkRebalanceFunction · 0.74
TestRegressionBucketsFunction · 0.74
TestRenameBucketFunction · 0.74
TestRenameObjectsFunction · 0.74
TestObjectPrefixFunction · 0.74
TestGetNodeStatsFunction · 0.74
TestGetClusterStatsFunction · 0.74