Skip to content

Commit

Permalink
Merge pull request #8446 from shirady/ci-increase-timeout
Browse files Browse the repository at this point in the history
CI | Increase Timeouts
  • Loading branch information
shirady authored Oct 9, 2024
2 parents 411b1e1 + a85b0a4 commit e4c7b7d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
27 changes: 14 additions & 13 deletions src/test/unit_tests/jest_tests/test_versioning_concurrency.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const buffer_utils = require('../../../util/buffer_utils');
const { TMP_PATH } = require('../../system_tests/test_utils');
const { crypto_random_string } = require('../../../util/string_utils');
const endpoint_stats_collector = require('../../../sdk/endpoint_stats_collector');
const SECONDS = 1000;
const test_timeout = SECONDS * 60;

function make_dummy_object_sdk(nsfs_config, uid, gid) {
return {
Expand Down Expand Up @@ -68,7 +70,7 @@ describe('test versioning concurrency', () => {
expect(failed_operations).toHaveLength(0);
const versions = await nsfs.list_object_versions({ bucket: bucket }, DUMMY_OBJECT_SDK);
expect(versions.objects.length).toBe(num_of_concurrency);
});
}, test_timeout);

it('multiple delete version id and key', async () => {
const bucket = 'bucket1';
Expand All @@ -88,7 +90,7 @@ describe('test versioning concurrency', () => {
await P.delay(1000);
expect(successful_operations).toHaveLength(num_of_concurrency);
expect(failed_operations).toHaveLength(0);
});
}, test_timeout);

// same as s3tests_boto3/functional/test_s3.py::test_versioning_concurrent_multi_object_delete,
// this test has a bug, it tries to create the bucket twice and fails
Expand Down Expand Up @@ -130,7 +132,7 @@ describe('test versioning concurrency', () => {
}
const list_res = await nsfs.list_objects({ bucket: bucket }, DUMMY_OBJECT_SDK);
expect(list_res.objects.length).toBe(0);
}, 8000);
}, test_timeout);

it('concurrent delete of latest version', async () => {
const bucket = 'bucket1';
Expand All @@ -154,7 +156,7 @@ describe('test versioning concurrency', () => {
expect(versions.objects.length).toBe(8); // 5 versions before + 3 delete markers concurrent
const delete_marker_arr = versions.objects.filter(object => object.delete_marker === true);
expect(delete_marker_arr.length).toBe(3);
});
}, test_timeout);

it('concurrent put object and head object latest version', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -182,7 +184,7 @@ describe('test versioning concurrency', () => {
expect(successful_head_operations.length).toBe(number_of_iterations);
const versions = await nsfs.list_object_versions({ bucket: bucket }, DUMMY_OBJECT_SDK);
expect(versions.objects.length).toBe(number_of_iterations + 1); // 1 version before + 10 versions concurrent
});
}, test_timeout);

it('concurrent puts & delete latest objects', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -216,7 +218,7 @@ describe('test versioning concurrency', () => {
expect(num_of_delete_markers).toBe(num_of_concurrency);
const num_of_latest_versions = (versions.objects.filter(version => version.is_latest === true)).length;
expect(num_of_latest_versions).toBe(1);
}, 6000);
}, test_timeout);

it('concurrent puts & delete objects by version id', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -250,7 +252,7 @@ describe('test versioning concurrency', () => {
expect(num_of_delete_markers).toBe(0);
const num_of_latest_versions = (versions.objects.filter(version => version.is_latest === true)).length;
expect(num_of_latest_versions).toBe(1);
}, 6000);
}, test_timeout);

it('concurrent delete objects by version id/latest', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -283,7 +285,7 @@ describe('test versioning concurrency', () => {
expect(num_of_delete_markers).toBe(num_of_concurrency);
const num_of_latest_versions = (versions.objects.filter(version => version.is_latest === true)).length;
expect(num_of_latest_versions).toBe(1);
}, 6000);
}, test_timeout);

it('nested key - concurrent delete multiple objects', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -320,8 +322,7 @@ describe('test versioning concurrency', () => {
}
const list_res = await nsfs.list_objects({ bucket: bucket }, DUMMY_OBJECT_SDK);
expect(list_res.objects).toHaveLength(0);
}, 8000);

}, test_timeout);

it('nested key - concurrent puts & deletes', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -349,7 +350,7 @@ describe('test versioning concurrency', () => {
expect(upload_failed_operations).toHaveLength(0);
expect(delete_successful_operations).toHaveLength(num_of_concurrency);
expect(delete_failed_operations).toHaveLength(0);
}, 6000);
}, test_timeout);

it('concurrent puts & list versions', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -389,7 +390,7 @@ describe('test versioning concurrency', () => {
expect(num_of_delete_markers).toBe(0);
const num_of_latest_versions = (versions.objects.filter(version => version.is_latest === true)).length;
expect(num_of_latest_versions).toBe(initial_num_of_objects);
}, 60000);
}, test_timeout);

it('concurrent puts & list versions - version id paging', async () => {
const bucket = 'bucket1';
Expand Down Expand Up @@ -432,7 +433,7 @@ describe('test versioning concurrency', () => {
expect(num_of_delete_markers).toBe(0);
const num_of_latest_versions = (merged_versions.filter(version => version.is_latest === true)).length;
expect(num_of_latest_versions).toBe(initial_num_of_objects);
}, 50000);
}, test_timeout);
});

/**
Expand Down
10 changes: 7 additions & 3 deletions src/test/unit_tests/test_bucketspace_versioning.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ mocha.describe('bucketspace namespace_fs - versioning', function() {
const suspended_dir1_versions_path = path.join(suspended_full_path, dir1, '.versions/');

mocha.before(async function() {
this.timeout(600000); // eslint-disable-line no-invalid-this
this.timeout(0); // eslint-disable-line no-invalid-this
if (invalid_nsfs_root_permissions()) this.skip(); // eslint-disable-line no-invalid-this
// create paths
await fs_utils.create_fresh_path(tmp_fs_root, 0o777);
Expand Down Expand Up @@ -158,6 +158,7 @@ mocha.describe('bucketspace namespace_fs - versioning', function() {
});

mocha.after(async () => {
this.timeout(0); // eslint-disable-line no-invalid-this
fs_utils.folder_delete(tmp_fs_root);
for (const email of accounts) {
await rpc_client.account.delete_account({ email });
Expand Down Expand Up @@ -2285,7 +2286,7 @@ mocha.describe('bucketspace namespace_fs - versioning', function() {
const version_body = 'A1A1A1A';

mocha.before(async function() {
this.timeout(600000); // eslint-disable-line no-invalid-this
this.timeout(0); // eslint-disable-line no-invalid-this
if (invalid_nsfs_root_permissions()) this.skip(); // eslint-disable-line no-invalid-this
// create paths
await fs_utils.create_fresh_path(tmp_fs_root2, 0o777);
Expand Down Expand Up @@ -2355,6 +2356,7 @@ mocha.describe('bucketspace namespace_fs - versioning', function() {
});

mocha.after(async () => {
this.timeout(0); // eslint-disable-line no-invalid-this
fs_utils.folder_delete(tmp_fs_root);
for (const email of accounts) {
await rpc_client.account.delete_account({ email });
Expand Down Expand Up @@ -2953,7 +2955,7 @@ mocha.describe('List-objects', function() {
let file_pointer;

mocha.before(async function() {
this.timeout(600000); // eslint-disable-line no-invalid-this
this.timeout(0); // eslint-disable-line no-invalid-this
if (process.getgid() !== 0 || process.getuid() !== 0) {
console.log('No Root permissions found in env. Skipping test');
this.skip(); // eslint-disable-line no-invalid-this
Expand Down Expand Up @@ -3038,6 +3040,7 @@ mocha.describe('List-objects', function() {
});

mocha.after(async () => {
this.timeout(0); // eslint-disable-line no-invalid-this
if (file_pointer) await file_pointer.close(DEFAULT_FS_CONFIG);
fs_utils.folder_delete(tmp_fs_root);
for (const email of accounts) {
Expand All @@ -3046,6 +3049,7 @@ mocha.describe('List-objects', function() {
});

mocha.beforeEach(async () => {
this.timeout(0); // eslint-disable-line no-invalid-this
await fs_utils.create_fresh_path(full_path2, 0o777);
await P.delay(100); // sometime we saw that the check failed although the path is created a line before
const file_exists = await fs_utils.file_exists(full_path2);
Expand Down

0 comments on commit e4c7b7d

Please sign in to comment.