restartServiceWithConfigOverlay stops a service, applies a config overlay, and restarts the service. The overlay file is merged onto the existing config, with overlay values taking precedence.
(t *testing.T, service *e2e.HTTPService, overlayPath string)
| 342 | // restartServiceWithConfigOverlay stops a service, applies a config overlay, and restarts the service. |
| 343 | // The overlay file is merged onto the existing config, with overlay values taking precedence. |
| 344 | func (h *TempoHarness) restartServiceWithConfigOverlay(t *testing.T, service *e2e.HTTPService, overlayPath string) error { |
| 345 | // Stop the service |
| 346 | err := service.Stop() |
| 347 | if strings.Contains(err.Error(), "exit status 137") { // 137 is returned by linux when it is force killed b/c it doesn't stop in time. |
| 348 | t.Logf("service %s was force killed during stop: %v", service.Name(), err) |
| 349 | } else if err != nil { |
| 350 | return fmt.Errorf("failed to stop service: %w", err) |
| 351 | } |
| 352 | |
| 353 | // Apply overlay to current config |
| 354 | err = applyConfigOverlay(h.TestScenario, overlayPath, nil) |
| 355 | if err != nil { |
| 356 | return fmt.Errorf("failed to apply config overlay: %w", err) |
| 357 | } |
| 358 | |
| 359 | // Restart the service |
| 360 | if err := service.Start(h.TestScenario.NetworkName(), h.TestScenario.SharedDir()); err != nil { |
| 361 | return fmt.Errorf("failed to restart service: %w", err) |
| 362 | } |
| 363 | |
| 364 | if err := service.WaitReady(); err != nil { |
| 365 | return fmt.Errorf("service did not become ready after restart: %w", err) |
| 366 | } |
| 367 | |
| 368 | return nil |
| 369 | } |
| 370 | |
| 371 | func (h *TempoHarness) WaitTracesWritable(t *testing.T) { |
| 372 | t.Helper() |
no test coverage detected