From 7ff6bae57f02aca5e789d6055596090a871d0fa3 Mon Sep 17 00:00:00 2001 From: ganeshvanahalli Date: Fri, 7 Jul 2023 17:16:52 -0400 Subject: [PATCH 1/4] update test name --- system_tests/forwarder_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system_tests/forwarder_test.go b/system_tests/forwarder_test.go index 3691caf5d2..6fce039bc1 100644 --- a/system_tests/forwarder_test.go +++ b/system_tests/forwarder_test.go @@ -295,7 +295,8 @@ func TestRedisForwarder(t *testing.T) { } } -func TestRedisForwarderFallbackNoRedis(t *testing.T) { +// TestRFFallbackNoRedis is shortened from "TestRedisForwarderFallbackNoRedis" name for ipc url path to be less than "max_socket_path_size" +func TestRFFallbackNoRedis(t *testing.T) { ctx := context.Background() fallbackIpcPath := tmpPath(t, "fallback.ipc") From ca0665a62fff510a305c3134e2dd72f7fa38f9af Mon Sep 17 00:00:00 2001 From: ganeshvanahalli Date: Tue, 11 Jul 2023 12:17:40 -0400 Subject: [PATCH 2/4] updated approach --- system_tests/forwarder_test.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/system_tests/forwarder_test.go b/system_tests/forwarder_test.go index 6fce039bc1..a8a749bde4 100644 --- a/system_tests/forwarder_test.go +++ b/system_tests/forwarder_test.go @@ -7,6 +7,7 @@ import ( "context" "fmt" "math/big" + "os" "path/filepath" "strings" "sync" @@ -157,7 +158,14 @@ func createSequencer( // tmpPath returns file path with specified filename from temporary directory of the test. func tmpPath(t *testing.T, filename string) string { - return filepath.Join(t.TempDir(), filename) + // create a unique, maximum 10 characters-long temporary directory {name} with path as $TMPDIR/{name} + tmpDir, _ := os.MkdirTemp("", "") + t.Cleanup(func() { + if err := os.RemoveAll(tmpDir); err != nil { + t.Errorf("tmpPath RemoveAll cleanup: %v", err) + } + }) + return filepath.Join(tmpDir, filename) } // testNodes creates specified number of paths for ipc from temporary directory of the test. @@ -295,8 +303,7 @@ func TestRedisForwarder(t *testing.T) { } } -// TestRFFallbackNoRedis is shortened from "TestRedisForwarderFallbackNoRedis" name for ipc url path to be less than "max_socket_path_size" -func TestRFFallbackNoRedis(t *testing.T) { +func TestRedisForwarderFallbackNoRedis(t *testing.T) { ctx := context.Background() fallbackIpcPath := tmpPath(t, "fallback.ipc") From 779211be71520519f119a14a685cda590a81e770 Mon Sep 17 00:00:00 2001 From: ganeshvanahalli Date: Tue, 11 Jul 2023 14:47:01 -0400 Subject: [PATCH 3/4] pad TMPDIR in CI --- .github/workflows/ci.yml | 2 +- system_tests/forwarder_test.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1a591b720..b614d79f54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,7 +133,7 @@ jobs: - name: Set environment variables run: | mkdir -p target/tmp - echo "TMPDIR=$(pwd)/target/tmp" >> "$GITHUB_ENV" + echo "TMPDIR=$(pwd)/target/tmp/deadbeefdeadbeefdeadbeefdeadbeefdead" >> "$GITHUB_ENV" echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV" echo "GOGC=80" >> "$GITHUB_ENV" diff --git a/system_tests/forwarder_test.go b/system_tests/forwarder_test.go index a8a749bde4..d4cf0d8eb7 100644 --- a/system_tests/forwarder_test.go +++ b/system_tests/forwarder_test.go @@ -158,11 +158,15 @@ func createSequencer( // tmpPath returns file path with specified filename from temporary directory of the test. func tmpPath(t *testing.T, filename string) string { + t.Helper() // create a unique, maximum 10 characters-long temporary directory {name} with path as $TMPDIR/{name} - tmpDir, _ := os.MkdirTemp("", "") + tmpDir, err := os.MkdirTemp("", "") + if err != nil { + t.Fatalf("Failed to create temp dir: %v", err) + } t.Cleanup(func() { - if err := os.RemoveAll(tmpDir); err != nil { - t.Errorf("tmpPath RemoveAll cleanup: %v", err) + if err = os.RemoveAll(tmpDir); err != nil { + t.Errorf("Failed to cleanup temp dir: %v", err) } }) return filepath.Join(tmpDir, filename) From af4c738d74158aec2f4c1e2ed233dd53de319aa3 Mon Sep 17 00:00:00 2001 From: ganeshvanahalli Date: Tue, 11 Jul 2023 15:10:10 -0400 Subject: [PATCH 4/4] fix padding --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b614d79f54..c77ef3b770 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,8 +132,8 @@ jobs: - name: Set environment variables run: | - mkdir -p target/tmp - echo "TMPDIR=$(pwd)/target/tmp/deadbeefdeadbeefdeadbeefdeadbeefdead" >> "$GITHUB_ENV" + mkdir -p target/tmp/deadbeefbee + echo "TMPDIR=$(pwd)/target/tmp/deadbeefbee" >> "$GITHUB_ENV" echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV" echo "GOGC=80" >> "$GITHUB_ENV"