e2e/cli-plugins: use identifiable output for test

This confused me fore a bit, because I thought the test was checking for
an actual `context.Canceled` error (which is spelled "context canceled"
with a single "l". But then I found that this was a string that's printed
as part of a test-utility, just looking very similar but with the British
spelling ("cancelled").

Let's change this to a message that's unique for the test, also to make it
more grep'able.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-07-04 17:08:14 +02:00
parent e9f32edac5
commit c6b40640cc
2 changed files with 11 additions and 8 deletions

View File

@ -39,7 +39,7 @@ func RootCmd(dockerCli command.Cli) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
go func() {
<-cmd.Context().Done()
_, _ = fmt.Fprintln(dockerCli.Out(), "context cancelled")
_, _ = fmt.Fprintln(dockerCli.Out(), "test-no-socket: exiting after context was done")
os.Exit(2)
}()
signalCh := make(chan os.Signal, 10)
@ -64,7 +64,7 @@ func RootCmd(dockerCli command.Cli) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
go func() {
<-cmd.Context().Done()
_, _ = fmt.Fprintln(dockerCli.Out(), "context cancelled")
_, _ = fmt.Fprintln(dockerCli.Out(), "test-socket: exiting after context was done")
os.Exit(2)
}()
signalCh := make(chan os.Signal, 10)