Skip to content

Commit

Permalink
Increased timeout for e2e tests of managed folder (#2540)
Browse files Browse the repository at this point in the history
* increase timeout

* small fix

* small fix

* lint fix

* lint fix

* dec time

* small fix
  • Loading branch information
Tulsishah authored Sep 27, 2024
1 parent 01d2308 commit b271f58
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ func (s *managedFoldersAdminPermission) Setup(t *testing.T) {
if s.managedFoldersPermission != "nil" {
providePermissionToManagedFolder(bucket, path.Join(testDir, ManagedFolder1), serviceAccount, s.managedFoldersPermission, t)
providePermissionToManagedFolder(bucket, path.Join(testDir, ManagedFolder2), serviceAccount, s.managedFoldersPermission, t)
// Waiting for 20 seconds for policy changes to propagate. This values we kept based on our experiments.
time.Sleep(20 * time.Second)
// Waiting for 60 seconds for policy changes to propagate. This values we kept based on our experiments.
time.Sleep(60 * time.Second)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"path"
"testing"
"time"

"github.com/googlecloudplatform/gcsfuse/v2/tools/integration_tests/util/creds_tests"
"github.com/googlecloudplatform/gcsfuse/v2/tools/integration_tests/util/operations"
Expand Down Expand Up @@ -62,7 +63,7 @@ func (s *managedFoldersViewPermission) TestCreateObjectInManagedFolder(t *testin
t.Errorf("Error in creating file locally.")
}
t.Cleanup(func() {
err := file.Close()
err = file.Close()
operations.CheckErrorForReadOnlyFileSystem(err, t)
})
}
Expand Down Expand Up @@ -161,6 +162,8 @@ func TestManagedFolders_FolderViewPermission(t *testing.T) {
// Provide storage.objectViewer role to managed folders.
providePermissionToManagedFolder(bucket, path.Join(testDir, ManagedFolder1), serviceAccount, IAMRoleForViewPermission, t)
providePermissionToManagedFolder(bucket, path.Join(testDir, ManagedFolder2), serviceAccount, IAMRoleForViewPermission, t)
// Waiting for 60 seconds for policy changes to propagate. This values we kept based on our experiments.
time.Sleep(60 * time.Second)

log.Printf("Running tests with flags and managed folder have view permissions: %s", flags)
test_setup.RunTests(t, ts)
Expand Down
2 changes: 1 addition & 1 deletion tools/integration_tests/run_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN_TEST_ON_TPC_ENDPOINT=false
if [ $4 != "" ]; then
RUN_TEST_ON_TPC_ENDPOINT=$4
fi
INTEGRATION_TEST_TIMEOUT_IN_MINS=70
INTEGRATION_TEST_TIMEOUT_IN_MINS=80

RUN_TESTS_WITH_PRESUBMIT_FLAG=false
if [ $# -ge 5 ] ; then
Expand Down
4 changes: 4 additions & 0 deletions tools/integration_tests/util/operations/validation_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func ValidateNoFileOrDirError(path string, t *testing.T) {
}

func CheckErrorForReadOnlyFileSystem(err error, t *testing.T) {
if err == nil {
t.Error("permission denied error expected but got nil error.")
return
}
if strings.Contains(err.Error(), "read-only file system") || strings.Contains(err.Error(), "permission denied") || strings.Contains(err.Error(), "Permission denied") {
return
}
Expand Down

0 comments on commit b271f58

Please sign in to comment.