Skip to content

Commit

Permalink
*: fix TestSupportedSuffixForServerDisk when in RBE (#48249)
Browse files Browse the repository at this point in the history
close #48225
  • Loading branch information
hawkingrei authored Nov 3, 2023
1 parent 420b524 commit d99c5a5
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit d99c5a5

Please sign in to comment.