Skip to content

Conversation

@benzekrimaha
Copy link
Contributor

@benzekrimaha benzekrimaha commented Oct 23, 2025

Please note that this PR also takles the rest of the unmigrated code , better to review it by commit to have the context

Issue: CLDSRV-724

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-service-get-related-functional-tests branch 3 times, most recently from 72dd6ed to cd35cca Compare October 28, 2025 15:59
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch 2 times, most recently from 425731c to 2b9959d Compare October 28, 2025 16:03
@scality scality deleted a comment from codecov bot Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 33.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.35%. Comparing base (0fec989) to head (df480a2).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/routes/routeBackbeat.js 33.33% 6 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/routes/routeBackbeat.js 75.79% <33.33%> (+2.40%) ⬆️

... and 28 files with indirect coverage changes

@@                                       Coverage Diff                                       @@
##           improvement/CLDSRV-724-service-get-related-functional-tests    #5985      +/-   ##
===============================================================================================
+ Coverage                                                        81.00%   84.35%   +3.34%     
===============================================================================================
  Files                                                              204      204              
  Lines                                                            12890    12899       +9     
===============================================================================================
+ Hits                                                             10442    10881     +439     
+ Misses                                                            2448     2018     -430     
Flag Coverage Δ
file-ft-tests 67.55% <0.00%> (+7.42%) ⬆️
kmip-ft-tests 28.11% <0.00%> (+<0.01%) ⬆️
mongo-v0-ft-tests 68.78% <0.00%> (+7.30%) ⬆️
mongo-v1-ft-tests 68.88% <0.00%> (+7.42%) ⬆️
multiple-backend 35.23% <0.00%> (-0.03%) ⬇️
sur-tests 36.35% <0.00%> (+0.78%) ⬆️
sur-tests-inflights 37.39% <0.00%> (-0.03%) ⬇️
unit 69.90% <33.33%> (-0.03%) ⬇️
utapi-v2-tests 34.22% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch 5 times, most recently from 8c9eb10 to 3ab4eae Compare November 13, 2025 10:44
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch 2 times, most recently from 17d2fcb to 198582c Compare November 20, 2025 17:19
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch 3 times, most recently from 2c806e4 to 836c556 Compare November 28, 2025 15:18
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch 2 times, most recently from 26ce909 to 8383cf9 Compare December 2, 2025 17:24
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-service-get-related-functional-tests branch from cd35cca to 0fec989 Compare December 4, 2025 06:39
@benzekrimaha benzekrimaha changed the title Improvement/cldsrv 724 backbeat related functional tests Improvement/cldsrv 724-backbeat-related-functional-tests Dec 4, 2025
* round robin is confined to each nodejs cluster processes
*/
const APPROX = Math.floor(0.1 * TOTAL_OBJECTS_PER_NODE);
const APPROX = Math.ceil(0.2 * TOTAL_OBJECTS_PER_NODE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you remember what happened here that you need to do this change ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old Math.floor(0.1 * TOTAL_OBJECTS_PER_NODE) let counts drift only ~10% low/high; on the ci we were still failing because a cluster process often handles more than 10%. Switching to Math.ceil(0.2 * TOTAL_OBJECTS_PER_NODE) widens that window to ±20% (and guarantees at least one packet of slack), so we stop treating normal round‑robin skew as a test failure.

Copy link
Contributor

@SylvainSenechal SylvainSenechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bigbig pr again. this time I left a bit more comments but actually not many changes requested, its mostly questions to double check the changes, and make sure we understand why the changes are done because I found 2/3 things were curious

@benzekrimaha benzekrimaha requested review from a team, SylvainSenechal and delthas December 11, 2025 18:40
Copy link
Contributor

@DarkIsDude DarkIsDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats again. Sylvain did a good review, not a lot to add more

password: ${{ secrets.ARTIFACTS_PASSWORD }}
source: /tmp/artifacts
if: always()
# ceph-backend-test:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just delete them ? We have githistory if needed

client = new DataFileInterface(config);
implName = 'file';
} else if (config.backends.data === 'multiple') {
Object.keys(config.locationConstraints).filter(k =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree too, it's weird ?

const expectedLocation = data.LocationConstraint || '';
assert.deepStrictEqual(expectedLocation, '');
// SDK v3 returns undefined for us-east-1, normalize to empty string for comparison
const locationConstraint = data.LocationConstraint || '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then if I get it right we can check that the value is undefined directly ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up ?

done();
}
} else if (testResult && typeof testResult === 'object' && testResult.code) {
// This was expected to be an error, but we got success
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This was expected to be an error, but we got success

'backend successfully', done => {
const key = `somekey-${genUniqID()}`;
async.waterfall([
next => waitForVersioningBeforePut(s3, bucket, err => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here and following iteration

Comment on lines 285 to 289
next => {
s3.send(new AbortMultipartUploadCommand(paramsAzure))
.then(() => next())
.catch(next);
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
next => {
s3.send(new AbortMultipartUploadCommand(paramsAzure))
.then(() => next())
.catch(next);
},
async() => s3.send(new AbortMultipartUploadCommand(paramsAzure)),

we can do that ?

});
});
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

}))
.then(() => next())
.catch(next),
next => s3.send(new DeleteObjectCommand({ Bucket: testBucket, Key: keyName1 }))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too (and it's not the only one)

Suggested change
next => s3.send(new DeleteObjectCommand({ Bucket: testBucket, Key: keyName1 }))
async () => s3.send(new DeleteObjectCommand({ Bucket: testBucket, Key: keyName1 })),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather keep the next here it's part of a chain

@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch from 3a0af19 to 7e3a81d Compare December 18, 2025 16:30
@benzekrimaha benzekrimaha force-pushed the improvement/CLDSRV-724-backbeat-related-functional-tests branch from 94d9c72 to ce181cb Compare December 19, 2025 06:24
Copy link
Contributor

@DarkIsDude DarkIsDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of them are nit. That's why it's approved. You can resolve them and merge or reassign me.

"@hapi/joi": "^17.1.1",
"@smithy/node-http-handler": "^3.0.0",
"arsenal": "git+https://github.com/scality/Arsenal#8.2.41",
"arsenal": "git+https://github.com/scality/Arsenal#d1de8c4ac819ee7363323fa8ab14fcdba37a5e65",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump arsenal, reminder for you

const expectedLocation = data.LocationConstraint || '';
assert.deepStrictEqual(expectedLocation, '');
// SDK v3 returns undefined for us-east-1, normalize to empty string for comparison
const locationConstraint = data.LocationConstraint || '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up ?

after(() => {
process.stdout.write('Deleting bucket\n');
return bucketUtil.deleteOne(bucketName)
.catch(err => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent 🙏

const data = await s3.send(new GetBucketLocationCommand({ Bucket: bucketName }));
assert.strictEqual(data.LocationConstraint, endpoint);

// S3C backend has 'dc-1' as default location constraint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code is pretty clean alone ?

utils.enableVersioning = async (s3, bucket) => {
await s3.send(new PutBucketVersioningCommand({
utils.enableVersioning = (s3, bucket, callback) => {
// Support both callback and promise patterns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Support both callback and promise patterns

That's not needed

try {
const results = [];
for (const data of dataArray) {
// Don't pass callback to putToAwsBackend - we need the version ID from the promise
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Don't pass callback to putToAwsBackend - we need the version ID from the promise


return fromIni({ profile, filepath: filename });
// Parse the INI file manually for synchronous access
const content = fs.readFileSync(filename, 'utf-8');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, do we really need that ? Why this change and not using the SDK or access the SDK config ?

MultipartUpload: { Parts: parts },
};
gcpClient.completeMultipartUpload(params, (err, res) => {
// eslint-disable-next-line no-console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be removed or the linter rule should be updated 🙏 ?


it('should successfully complete MPU',
function testFn(done) {
this.timeout(1200000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe explain the why here ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, ci passing without it

Copy link
Contributor

@SylvainSenechal SylvainSenechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last comments addressed in another pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants