()
| 112 | } |
| 113 | |
| 114 | func beChildForTestHTTPPool() { |
| 115 | addrs := strings.Split(*peerAddrs, ",") |
| 116 | |
| 117 | p := NewHTTPPool("http://" + addrs[*peerIndex]) |
| 118 | p.Set(addrToURL(addrs)...) |
| 119 | |
| 120 | getter := GetterFunc(func(ctx context.Context, key string, dest Sink) error { |
| 121 | dest.SetString(strconv.Itoa(*peerIndex) + ":" + key) |
| 122 | return nil |
| 123 | }) |
| 124 | NewGroup("httpPoolTest", 1<<20, getter) |
| 125 | |
| 126 | log.Fatal(http.ListenAndServe(addrs[*peerIndex], p)) |
| 127 | } |
| 128 | |
| 129 | // This is racy. Another process could swoop in and steal the port between the |
| 130 | // call to this function and the next listen call. Should be okay though. |
no test coverage detected
searching dependent graphs…