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

[Feature/Identity] Fixes test failures in gradle check for #4798 #5441

Conversation

DarshitChanpura
Copy link
Member

@DarshitChanpura DarshitChanpura commented Dec 3, 2022

Description

As a follow-up for #4798, this PR fixes test failures that were noticed in CI gradle check.

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
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@DarshitChanpura DarshitChanpura force-pushed the basic-auth-via-internal-idp branch from fad340f to e04e786 Compare December 3, 2022 06:45
@DarshitChanpura DarshitChanpura changed the title [Feature/Identity] Fixes test failures during gradle check [Feature/Identity] Fixes test failures in gradle check for #4798 Dec 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 3, 2022

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura DarshitChanpura force-pushed the basic-auth-via-internal-idp branch from 50de65b to ce38d69 Compare December 6, 2022 19:20
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura DarshitChanpura force-pushed the basic-auth-via-internal-idp branch from ce38d69 to 57df6b6 Compare December 6, 2022 19:23
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura DarshitChanpura force-pushed the basic-auth-via-internal-idp branch from d49b703 to 0e91f95 Compare December 7, 2022 00:21
@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Dec 7, 2022

Gradle check ran for a little above 2hrs and then was aborted. This is significantly higher than current main's build time which is 32mins 10secs for gradle check.

The likely culprit is the logout calls on every login resulting in added time. I'm working on finding a better solution than this.

private static void logoutCurrentSubjectAndClearSessionIfAny() {
try {
// logout current subject
org.apache.shiro.subject.Subject subject = SecurityUtils.getSubject();
if (subject == null) return;
subject.logout();
// Get current session and kill it before proceeding to create a new session
// TODO: need to study the impact of this
Session session = subject.getSession(false);
if (session == null) return;
session.stop();
} catch (Exception e) {
// Ignore all errors, as we're trying to silently kill the session
}
}

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.rest.RestControllerTests.testRestRequestAuthenticationFailure

@codecov-commenter
Copy link

codecov-commenter commented Dec 7, 2022

Codecov Report

Merging #5441 (dea9f34) into feature/identity (c39a92b) will increase coverage by 0.22%.
The diff coverage is 80.00%.

@@                  Coverage Diff                   @@
##             feature/identity    #5441      +/-   ##
======================================================
+ Coverage               70.86%   71.09%   +0.22%     
- Complexity              58405    58560     +155     
======================================================
  Files                    4769     4769              
  Lines                  278958   278962       +4     
  Branches                40300    40301       +1     
======================================================
+ Hits                   197681   198323     +642     
+ Misses                  65087    64457     -630     
+ Partials                16190    16182       -8     
Impacted Files Coverage Δ
...in/java/org/opensearch/authn/noop/NoopSubject.java 60.00% <0.00%> (-6.67%) ⬇️
...g/opensearch/authn/AuthenticationTokenHandler.java 84.00% <100.00%> (ø)
...org/opensearch/authn/internal/InternalSubject.java 71.42% <100.00%> (+38.09%) ⬆️
...port/ResponseHandlerFailureTransportException.java 0.00% <0.00%> (-60.00%) ⬇️
...opensearch/persistent/PersistentTasksExecutor.java 22.22% <0.00%> (-44.45%) ⬇️
...rc/main/java/org/opensearch/ingest/IngestInfo.java 51.72% <0.00%> (-27.59%) ⬇️
.../java/org/opensearch/index/reindex/RemoteInfo.java 51.37% <0.00%> (-27.53%) ⬇️
...ava/org/opensearch/threadpool/ThreadPoolStats.java 58.66% <0.00%> (-22.67%) ⬇️
...nsearch/index/shard/IndexingOperationListener.java 65.57% <0.00%> (-21.32%) ⬇️
...main/java/org/opensearch/ingest/ProcessorInfo.java 47.36% <0.00%> (-21.06%) ⬇️
... and 484 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@DarshitChanpura DarshitChanpura force-pushed the basic-auth-via-internal-idp branch from d4cf808 to 5db6f1b Compare December 7, 2022 04:22
@DarshitChanpura
Copy link
Member Author

Follow-up: Add tests for isAuthenticated(), logout() and verifying number of calls to login() method

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.stats.IndexStatsIT.testFilterCacheStats

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura
Copy link
Member Author

Follow-up: Add tests for isAuthenticated(), logout() and verifying number of calls to login() method

Done.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura DarshitChanpura marked this pull request as ready for review December 7, 2022 18:45
@DarshitChanpura DarshitChanpura requested review from a team and reta as code owners December 7, 2022 18:45
@DarshitChanpura DarshitChanpura requested review from peternied, cwperks and stephen-crawford and removed request for a team and reta December 7, 2022 18:45
Signed-off-by: Darshit Chanpura <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura
Copy link
Member Author

@peternied This change might not be needed at all if we were to discard the check of whether user is currently logged in and whether the new request is by same user, because CI for latest commit c39a92b in feature/identity is passing

@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Gradle Check (Jenkins) Run Completed with:

@DarshitChanpura DarshitChanpura force-pushed the basic-auth-via-internal-idp branch from 9ec3597 to dea9f34 Compare January 4, 2023 21:23
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2023

Gradle Check (Jenkins) Run Completed with:

@peternied
Copy link
Member

@peternied This change might not be needed at all if we were to discard the check of whether user is currently logged in and whether the new request is by same user, because CI for latest commit c39a92b in feature/identity is passing

Being that CI is working I'd say maybe its better to close this out as unneeded - thanks for digging in!

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.

5 participants