From 5e7948ec838ed3df5b4a11721131b446260f8fbb Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 4 Jul 2024 17:36:41 +0200 Subject: [PATCH] e2e/cli-plugins: rename var that shadowed import Signed-off-by: Sebastiaan van Stijn --- e2e/cli-plugins/socket_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/e2e/cli-plugins/socket_test.go b/e2e/cli-plugins/socket_test.go index 5e0b1cbb7c..b34982c32b 100644 --- a/e2e/cli-plugins/socket_test.go +++ b/e2e/cli-plugins/socket_test.go @@ -37,7 +37,7 @@ func TestPluginSocketBackwardsCompatible(t *testing.T) { err := syscall.Kill(-command.Process.Pid, syscall.SIGINT) assert.NilError(t, err, "failed to signal process group") }() - bytes, err := io.ReadAll(ptmx) + out, err := io.ReadAll(ptmx) if err != nil && !strings.Contains(err.Error(), "input/output error") { t.Fatal("failed to get command output") } @@ -45,7 +45,7 @@ func TestPluginSocketBackwardsCompatible(t *testing.T) { // the plugin is attached to the TTY, so the parent process // ignores the received signal, and the plugin receives a SIGINT // as well - assert.Equal(t, string(bytes), "received SIGINT\r\nexit after 3 seconds\r\n") + assert.Equal(t, string(out), "received SIGINT\r\nexit after 3 seconds\r\n") }) // ensure that we don't break plugins that attempt to read from the TTY @@ -95,13 +95,13 @@ func TestPluginSocketBackwardsCompatible(t *testing.T) { err := syscall.Kill(command.Process.Pid, syscall.SIGINT) assert.NilError(t, err, "failed to signal process group") }() - bytes, err := command.CombinedOutput() - t.Log("command output: " + string(bytes)) + out, err := command.CombinedOutput() + t.Log("command output: " + string(out)) assert.NilError(t, err, "failed to run command") // the plugin process does not receive a SIGINT // so it exits after 3 seconds and prints this message - assert.Equal(t, string(bytes), "exit after 3 seconds\n") + assert.Equal(t, string(out), "exit after 3 seconds\n") }) t.Run("the main CLI exits after 3 signals", func(t *testing.T) { @@ -130,13 +130,13 @@ func TestPluginSocketBackwardsCompatible(t *testing.T) { err = syscall.Kill(command.Process.Pid, syscall.SIGINT) assert.NilError(t, err, "failed to signal process group") }() - bytes, err := command.CombinedOutput() + out, err := command.CombinedOutput() assert.ErrorContains(t, err, "exit status 1") // the plugin process does not receive a SIGINT and does // the CLI cannot cancel it over the socket, so it kills // the plugin process and forcefully exits - assert.Equal(t, string(bytes), "got 3 SIGTERM/SIGINTs, forcefully exiting\n") + assert.Equal(t, string(out), "got 3 SIGTERM/SIGINTs, forcefully exiting\n") }) }) } @@ -161,7 +161,7 @@ func TestPluginSocketCommunication(t *testing.T) { err := syscall.Kill(-command.Process.Pid, syscall.SIGINT) assert.NilError(t, err, "failed to signal process group") }() - bytes, err := io.ReadAll(ptmx) + out, err := io.ReadAll(ptmx) if err != nil && !strings.Contains(err.Error(), "input/output error") { t.Fatal("failed to get command output") } @@ -169,7 +169,7 @@ func TestPluginSocketCommunication(t *testing.T) { // the plugin is attached to the TTY, so the parent process // ignores the received signal, and the plugin receives a SIGINT // as well - assert.Equal(t, string(bytes), "received SIGINT\r\nexit after 3 seconds\r\n") + assert.Equal(t, string(out), "received SIGINT\r\nexit after 3 seconds\r\n") }) })