Skip to content
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

Fix sources of test instability #368

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,16 @@ func assertServerHealth(ctx context.Context, t *testing.T, opts sdkclient.Option
t.Error(clientErr)
}

if _, err := c.CheckHealth(ctx, nil); err != nil {
t.Error(err)
// Give the server 1 second to become healthy.
josh-berry marked this conversation as resolved.
Show resolved Hide resolved
for i := 0; i < 10; i++ {
_, clientErr = c.CheckHealth(ctx, nil)
if clientErr == nil {
break
}
time.Sleep(100 * time.Millisecond)
}
if clientErr != nil {
t.Error(clientErr)
}

// Check for pollers on a system task queue to ensure that the worker service is running.
Expand Down
1 change: 1 addition & 0 deletions server/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ func NewServerCommands(defaultCfg *sconfig.Config) []*cli.Command {
if err := s.Start(); err != nil {
return cli.Exit(fmt.Sprintf("Unable to start server. Error: %v", err), 1)
}
s.Stop()
return cli.Exit("All services are stopped.", 0)
},
},
Expand Down