Fix nonsensical in fileclient timeout error message

This commit is contained in:
Daniel A. Wozniak 2023-12-27 11:15:09 -07:00 committed by Daniel Wozniak
parent 15616715d4
commit abe92390c3
3 changed files with 4 additions and 2 deletions

1
changelog/65752.fixed.md Normal file
View file

@ -0,0 +1 @@
Fix nonsensical time in fileclient timeout error.

View file

@ -1157,7 +1157,7 @@ class RemoteClient(Client):
)
except salt.exceptions.SaltReqTimeoutError:
raise SaltClientError(
f"File client timed out after {int(time.time() - start)}"
f"File client timed out after {int(time.monotonic() - start)}"
)
def destroy(self):

View file

@ -126,7 +126,8 @@ def test_fileclient_timeout(minion_opts, master_opts):
# Crypticle must return bytes to pass to transport.RequestClient.send
client.auth._crypticle = Mock()
client.auth._crypticle.dumps = mock_dumps
with pytest.raises(salt.exceptions.SaltClientError):
msg = r"^File client timed out after \d{1,4}$"
with pytest.raises(salt.exceptions.SaltClientError, match=msg):
client.file_list()