Scripts: update host timeout error message (#13626)

- Update copy for erorr message we display when we haven't heard back
from the host in over 1 minute.
This commit is contained in:
Noah Talerman 2023-08-31 18:01:14 -04:00 committed by GitHub
parent a02b8b140d
commit b7868831c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -1137,9 +1137,9 @@ func (hsr HostScriptResult) AuthzType() string {
func (hsr HostScriptResult) UserMessage(hostTimeout bool) string {
switch {
case hostTimeout:
return "Fleet hasn't heard from the host in over 1 minute because it went offline. Run the script again when the host comes back online."
return "Fleet hasn't heard from the host in over 1 minute. Fleet doesn't know if the script ran because the host went offline."
case !hostTimeout && time.Since(hsr.CreatedAt) > time.Minute:
return "Fleet hasn't heard from the host in over 1 minute because it went offline. Run the script again when the host comes back online."
return "Fleet hasn't heard from the host in over 1 minute. Fleet doesn't know if the script ran because the host went offline."
case hsr.ExitCode.Int64 == -1:
return "Timeout. Fleet stopped the script after 30 seconds to protect host performance."
case hsr.ExitCode.Int64 == -2:

View file

@ -3762,7 +3762,7 @@ func (s *integrationEnterpriseTestSuite) TestRunHostScript() {
require.Equal(t, host.ID, runSyncResp.HostID)
require.NotEmpty(t, runSyncResp.ExecutionID)
require.True(t, runSyncResp.HostTimeout)
require.Contains(t, runSyncResp.Message, "Fleet hasn't heard from the host in over 1 minute because it went offline.")
require.Contains(t, runSyncResp.Message, "Fleet hasn't heard from the host in over 1 minute. Fleet doesn't know if the script ran because the host went offline.")
s.DoJSON("POST", "/api/fleet/orbit/scripts/result",
json.RawMessage(fmt.Sprintf(`{"orbit_node_key": %q, "execution_id": %q, "exit_code": 0, "output": "ok"}`, *host.OrbitNodeKey, runSyncResp.ExecutionID)),