diff --git a/tools/integration_tests/managed_folders/admin_permissions_test.go b/tools/integration_tests/managed_folders/admin_permissions_test.go index 93cc21314e..bec60fb259 100644 --- a/tools/integration_tests/managed_folders/admin_permissions_test.go +++ b/tools/integration_tests/managed_folders/admin_permissions_test.go @@ -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) } } diff --git a/tools/integration_tests/managed_folders/view_permissions_test.go b/tools/integration_tests/managed_folders/view_permissions_test.go index 94159c4c50..51e1dc7251 100644 --- a/tools/integration_tests/managed_folders/view_permissions_test.go +++ b/tools/integration_tests/managed_folders/view_permissions_test.go @@ -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" @@ -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) }) } @@ -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) diff --git a/tools/integration_tests/run_e2e_tests.sh b/tools/integration_tests/run_e2e_tests.sh index 69550b8ecc..7602b6956d 100755 --- a/tools/integration_tests/run_e2e_tests.sh +++ b/tools/integration_tests/run_e2e_tests.sh @@ -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 diff --git a/tools/integration_tests/util/operations/validation_helper.go b/tools/integration_tests/util/operations/validation_helper.go index b0f798a375..9fa2a7dce2 100644 --- a/tools/integration_tests/util/operations/validation_helper.go +++ b/tools/integration_tests/util/operations/validation_helper.go @@ -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 }