Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: fix TestSupportedSuffixForServerDisk when in RBE #48249

Merged
8 changes: 7 additions & 1 deletion pkg/executor/importer/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"net/url"
"os"
"os/user"
"path"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -308,6 +309,11 @@ func TestGetBackendWorkerConcurrency(t *testing.T) {
}

func TestSupportedSuffixForServerDisk(t *testing.T) {
username, err := user.Current()
require.NoError(t, err)
if username.Name == "root" {
t.Skip("it cannot run as root")
}
tempDir := t.TempDir()
ctx := context.Background()

Expand Down Expand Up @@ -363,7 +369,7 @@ func TestSupportedSuffixForServerDisk(t *testing.T) {
require.ErrorContains(t, err2, "URI of data source is invalid")
// non-exist parent directory
c.Path = "/path/to/non/exists/file.csv"
err := c.InitDataFiles(ctx)
err = c.InitDataFiles(ctx)
require.ErrorIs(t, err, exeerrors.ErrLoadDataInvalidURI)
require.ErrorContains(t, err, "no such file or directory")
// without permission to parent dir
Expand Down