Skip to content

Commit

Permalink
add timeouts
Browse files Browse the repository at this point in the history
Signed-off-by: Romy <[email protected]>
  • Loading branch information
romayalon committed Mar 2, 2025
1 parent f5bda99 commit abe8dae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/test/unit_tests/jest_tests/test_nc_bucket_cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const os_util = require('../../../util/os_utils');
const fs_utils = require('../../../util/fs_utils');
const { ConfigFS } = require('../../../sdk/config_fs');
const { set_path_permissions_and_owner, TMP_PATH, generate_s3_policy, CLI_UNSET_EMPTY_STRING,
set_nc_config_dir_in_config } = require('../../system_tests/test_utils');
set_nc_config_dir_in_config, TEST_TIMEOUT } = require('../../system_tests/test_utils');
const { ACTIONS, TYPES } = require('../../../manage_nsfs/manage_nsfs_constants');
const { get_process_fs_context, is_path_exists, get_bucket_tmpdir_full_path } = require('../../../util/native_fs_utils');
const ManageCLIError = require('../../../manage_nsfs/manage_nsfs_cli_errors').ManageCLIError;
Expand Down Expand Up @@ -68,7 +68,7 @@ describe('manage nsfs cli bucket flow', () => {
// account add (account 2 without new_buckets_path)
const account_options2 = { config_root, ...account_defaults2 };
await exec_manage_cli(TYPES.ACCOUNT, action, account_options2);
});
}, TEST_TIMEOUT);

afterEach(async () => {
await fs_utils.folder_delete(`${config_root}`);
Expand Down Expand Up @@ -284,7 +284,7 @@ describe('manage nsfs cli bucket flow', () => {
await fs_utils.create_fresh_path(bucket_path);
await fs_utils.file_must_exist(bucket_path);
await set_path_permissions_and_owner(bucket_path, account_options, 0o700);
});
}, TEST_TIMEOUT);

afterEach(async () => {
await fs_utils.folder_delete(`${config_root}`);
Expand Down Expand Up @@ -474,7 +474,7 @@ describe('manage nsfs cli bucket flow', () => {
const resp = await exec_manage_cli(TYPES.BUCKET, action, bucket_options);
const bucket_resp = JSON.parse(resp);
expect(bucket_resp.response.reply._id).not.toBeNull();
});
}, TEST_TIMEOUT);

afterEach(async () => {
await fs_utils.folder_delete(`${config_root}`);
Expand Down Expand Up @@ -708,7 +708,7 @@ describe('manage nsfs cli bucket flow', () => {
bucket_temp_dir_path = get_bucket_tmpdir_full_path(bucket_storage_path, bucket_resp.response.reply._id);
await fs_utils.create_fresh_path(bucket_temp_dir_path);
await fs_utils.file_must_exist(bucket_temp_dir_path);
});
}, TEST_TIMEOUT);

afterEach(async () => {
await fs_utils.folder_delete(`${config_root}`);
Expand Down Expand Up @@ -827,7 +827,7 @@ describe('manage nsfs cli bucket flow', () => {
const resp = await exec_manage_cli(TYPES.BUCKET, action, bucket_options);
const bucket_resp = JSON.parse(resp);
expect(bucket_resp.response.reply._id).not.toBeNull();
});
}, TEST_TIMEOUT);

afterEach(async () => {
await fs_utils.folder_delete(`${config_root}`);
Expand Down Expand Up @@ -887,7 +887,7 @@ describe('manage nsfs cli bucket flow', () => {
const resp = await exec_manage_cli(TYPES.BUCKET, action, bucket_options);
const bucket_resp = JSON.parse(resp);
expect(bucket_resp.response.reply._id).not.toBeNull();
});
}, TEST_TIMEOUT);

afterEach(async () => {
await fs_utils.folder_delete(`${config_root}`);
Expand Down
4 changes: 2 additions & 2 deletions src/test/unit_tests/test_nc_cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { get_process_fs_context } = require('../../util/native_fs_utils');
const { ManageCLIError } = require('../../manage_nsfs/manage_nsfs_cli_errors');
const { ManageCLIResponse } = require('../../manage_nsfs/manage_nsfs_cli_responses');
const { exec_manage_cli, generate_s3_policy, create_fs_user_by_platform, delete_fs_user_by_platform,
set_path_permissions_and_owner, TMP_PATH, set_nc_config_dir_in_config } = require('../system_tests/test_utils');
set_path_permissions_and_owner, TMP_PATH, set_nc_config_dir_in_config, TEST_TIMEOUT } = require('../system_tests/test_utils');
const { TYPES, ACTIONS } = require('../../manage_nsfs/manage_nsfs_constants');

const tmp_fs_path = path.join(TMP_PATH, 'test_bucketspace_fs');
Expand Down Expand Up @@ -113,7 +113,7 @@ mocha.describe('manage_nsfs cli', function() {
await fs_utils.file_must_exist(new_buckets_path2);
await set_path_permissions_and_owner(new_buckets_path2, { uid: account_options2.uid, gid: account_options2.gid }, 0o700);
await exec_manage_cli(TYPES.ACCOUNT, action, account_options2);
});
}, TEST_TIMEOUT);

mocha.it('cli bucket create - should fail bucket owner\'s allow_bucket_creation is false', async function() {
const account_name_for_account_cannot_create_bucket = 'user3';
Expand Down

0 comments on commit abe8dae

Please sign in to comment.