-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shutdown delay and e2e test #3395
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -312,6 +312,39 @@ func TestMicroservicesWithKVStores(t *testing.T) { | |
} | ||
} | ||
|
||
func TestShutdownDelay(t *testing.T) { | ||
s, err := e2e.NewScenario("tempo_e2e") | ||
require.NoError(t, err) | ||
defer s.Close() | ||
|
||
// set up the backend | ||
cfg := app.Config{} | ||
buff, err := os.ReadFile(configAllInOneS3) | ||
require.NoError(t, err) | ||
err = yaml.UnmarshalStrict(buff, &cfg) | ||
require.NoError(t, err) | ||
_, err = backend.New(s, cfg) | ||
require.NoError(t, err) | ||
|
||
require.NoError(t, util.CopyFileToSharedDir(s, configAllInOneS3, "config.yaml")) | ||
tempo := util.NewTempoAllInOne("-shutdown-delay=5s") | ||
require.NoError(t, s.StartAndWaitReady(tempo)) | ||
tempo.SetReadinessProbe(nil) | ||
|
||
// if we're here the readiness flag is up. now call kill and check the readiness flag is down | ||
go func() { | ||
_ = tempo.Stop() | ||
}() | ||
|
||
time.Sleep(500 * time.Millisecond) | ||
|
||
// confirm the readiness flag is down | ||
res, err := e2e.DoGet("http://" + tempo.Endpoint(3200) + "/ready") | ||
require.NoError(t, err) | ||
require.Equal(t, http.StatusServiceUnavailable, res.StatusCode) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps perform a query before and after to confirm the change in behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not apparent, but this line waits until There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added a comment to help clarify that the /ready point is confirmed to be up before we stop tempo |
||
defer res.Body.Close() | ||
} | ||
|
||
func TestScalableSingleBinary(t *testing.T) { | ||
s, err := e2e.NewScenario("tempo_e2e") | ||
require.NoError(t, err) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to sleep when there are no requests in flight?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm concerned about the complexity about that change. this is a very simple one that will do nearly all of what we want with some config choices in k8s