Files
my-rook-config/pkg/util/exec
Blaine Gardner 137b627737 test: update ExecuteCommandWithTimeout unit test
Update the unit test for ExecuteCommandWithTimeout(). This unit failed a
CI run. This seems to have been a race condition where the previous
`cat` command was returning quickly enough that it was available to the
`select` statment at the same time as the timeout.

Resolve this issue by replacing the `cat` command with `sleep`, which
will be guaranteed to take longer to return than the timeout, ensuring
this race doesn't happen.

While working on the test, I also notice that the 30 second timeouts for
other tests would be too long in the event the commands hang for any
reason, so lower these to help ensure the CI won't time out due to
unforeseen events.

Also add a missing unit test to ensure error returns (via `false`
command) without timeouts are properly returned.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-04-14 12:19:37 -06:00
..
2025-03-26 10:41:48 -07:00
2025-03-26 10:41:48 -07:00
2025-03-26 10:41:48 -07:00