git » chasquid » commit eeb2deb

courier: Don't hardcode path to `sleep` binary in the tests

author ThinkChaos
2025-08-11 22:48:39 UTC
committer Alberto Bertogli
2025-08-13 22:10:16 UTC
parent 6b66731850d11fef8798d96c14bf4956a60fbf0d

courier: Don't hardcode path to `sleep` binary in the tests

On NixOS, `/bin` is basically empty and this causes the courier tests
(which invoke `/bin/sleep`) to fail.

This patch fixes the tests by removing the hardcoded path.

https://github.com/albertito/chasquid/pull/73

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Adjusted commit message.

internal/courier/mda_test.go +1 -1

diff --git a/internal/courier/mda_test.go b/internal/courier/mda_test.go
index 16f290e..9ecc46f 100644
--- a/internal/courier/mda_test.go
+++ b/internal/courier/mda_test.go
@@ -31,7 +31,7 @@ func TestMDA(t *testing.T) {
 }
 
 func TestMDATimeout(t *testing.T) {
-	p := MDA{"/bin/sleep", []string{"1"}, 100 * time.Millisecond}
+	p := MDA{"sleep", []string{"1"}, 100 * time.Millisecond}
 
 	err, permanent := p.Deliver("from", "to@local", []byte("data"))
 	if err != errTimeout {