Skip to content

Commit

Permalink
rely on testing temp dir for testing files
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyzags committed Jan 27, 2025
1 parent 6cf947b commit bedf1a1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/relayer/relayminer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net"
"net/http"
"os"
"path/filepath"
"testing"
"time"

Expand Down Expand Up @@ -102,10 +102,9 @@ func TestRelayMiner_Ping(t *testing.T) {

time.Sleep(time.Millisecond)

filename := "/tmp/relayerminer.ping.sock"
relayminerSocketPath := filepath.Join(t.TempDir(), "relayerminer.ping.sock")

relayminer.ServePing(ctx, "unix", filename)
defer os.Remove(filename)
relayminer.ServePing(ctx, "unix", relayminerSocketPath)

time.Sleep(time.Millisecond)

Expand Down

0 comments on commit bedf1a1

Please sign in to comment.