(t *testing.T)
| 1156 | } |
| 1157 | |
| 1158 | func newBlockingOpenHost(t *testing.T) (*Host, *config.Config, <-chan struct{}, func()) { |
| 1159 | t.Helper() |
| 1160 | |
| 1161 | inner := newTestSymbolLoader() |
| 1162 | plugin := &testPlugin{ |
| 1163 | registerResult: validTestPlugin("alpha"), |
| 1164 | reconfigureResult: validTestPlugin("alpha"), |
| 1165 | } |
| 1166 | inner.lookups["alpha"] = newTestSymbolLookup(plugin) |
| 1167 | |
| 1168 | openStarted := make(chan struct{}) |
| 1169 | release := make(chan struct{}) |
| 1170 | var releaseOnce sync.Once |
| 1171 | releaseOpen := func() { releaseOnce.Do(func() { close(release) }) } |
| 1172 | t.Cleanup(releaseOpen) |
| 1173 | |
| 1174 | h := NewForTest(&blockingOpenLoader{ |
| 1175 | inner: inner, |
| 1176 | started: openStarted, |
| 1177 | release: release, |
| 1178 | }) |
| 1179 | cfg := &config.Config{ |
| 1180 | Plugins: config.PluginsConfig{ |
| 1181 | Enabled: true, |
| 1182 | Dir: makePluginDir(t, "alpha"), |
| 1183 | Configs: enabledPluginConfigs("alpha"), |
| 1184 | }, |
| 1185 | } |
| 1186 | return h, cfg, openStarted, releaseOpen |
| 1187 | } |
| 1188 | |
| 1189 | func newBlockingRegisterHost(t *testing.T) (*Host, *config.Config, <-chan struct{}, func()) { |
| 1190 | t.Helper() |
no test coverage detected