Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix flaky test due to localization #1734

Conversation

Hailong-am
Copy link
Contributor

@Hailong-am Hailong-am commented Dec 5, 2023

Description

CI run with locale -Dtests.locale=tr -Dtests.timezone=Cuba https://github.com/opensearch-project/ml-commons/actions/runs/7097212068/job/19316954587?pr=1733

related to aws/aws-encryption-sdk-java#1879

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@Hailong-am Hailong-am temporarily deployed to ml-commons-cicd-env December 5, 2023 08:26 — with GitHub Actions Inactive
@Hailong-am Hailong-am temporarily deployed to ml-commons-cicd-env December 5, 2023 08:26 — with GitHub Actions Inactive
@Hailong-am Hailong-am temporarily deployed to ml-commons-cicd-env December 5, 2023 08:26 — with GitHub Actions Inactive
Copy link

codecov bot commented Dec 5, 2023

Codecov Report

Attention: 32 lines in your changes are missing coverage. Please review.

Comparison is base (bb86968) 68.60% compared to head (094a4d6) 68.96%.
Report is 2 commits behind head on feature/agent_framework_dev.

Files Patch % Lines
...nsearch/ml/engine/tools/AbstractRetrieverTool.java 74.19% 14 Missing and 2 partials ⚠️
...a/org/opensearch/ml/engine/tools/VectorDBTool.java 0.00% 11 Missing ⚠️
...g/opensearch/ml/engine/tools/NeuralSparseTool.java 86.48% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##             feature/agent_framework_dev    #1734      +/-   ##
=================================================================
+ Coverage                          68.60%   68.96%   +0.36%     
- Complexity                          2591     2608      +17     
=================================================================
  Files                                239      241       +2     
  Lines                              12757    12815      +58     
  Branches                            1284     1288       +4     
=================================================================
+ Hits                                8752     8838      +86     
+ Misses                              3404     3373      -31     
- Partials                             601      604       +3     
Flag Coverage Δ
ml-commons 68.96% <73.77%> (+0.36%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Hailong-am
Copy link
Contributor Author

@ylwu-amzn @Zhangxunmt please help to review

Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

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

FYI, found this bug on flow framework and have submitted an issue and PR fix upstream.

See opensearch-project/flow-framework#239

@@ -68,7 +68,8 @@ public String encrypt(String plainText) {
initMasterKey();
final AwsCrypto crypto = AwsCrypto.builder().withCommitmentPolicy(CommitmentPolicy.RequireEncryptRequireDecrypt).build();
byte[] bytes = Base64.getDecoder().decode(masterKey);
JceMasterKey jceMasterKey = JceMasterKey.getInstance(new SecretKeySpec(bytes, "AES"), "Custom", "", "AES/GCM/NoPadding");
// https://github.com/aws/aws-encryption-sdk-java/issues/1879
JceMasterKey jceMasterKey = JceMasterKey.getInstance(new SecretKeySpec(bytes, "AES"), "Custom", "", "AES/GCM/NOPADDING");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this break BWC ?

Copy link
Member

Choose a reason for hiding this comment

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

Will this break BWC ?

No, the string is uppercased by the method being called. We are just preemptively uppercasing to avoid the wrong uppercase I in Turkish locale.

@ylwu-amzn ylwu-amzn merged commit 2299969 into opensearch-project:feature/agent_framework_dev Dec 5, 2023
4 of 7 checks passed
@Hailong-am Hailong-am deleted the fix_flaky_test branch January 11, 2024 07:58
@mingshl mingshl added the flaky-test Flaky build or test issue label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Flaky build or test issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants