Skip to content

Fix basic auth integration test#15679

Merged
abhishekrb19 merged 3 commits intoapache:masterfrom
kfaraz:fix_auth_it
Jan 14, 2024
Merged

Fix basic auth integration test#15679
abhishekrb19 merged 3 commits intoapache:masterfrom
kfaraz:fix_auth_it

Conversation

@kfaraz
Copy link
Copy Markdown
Contributor

@kfaraz kfaraz commented Jan 14, 2024

Changes

  • Add a delay of 5s in ITBasicAuthConfigurationTest after completing setup of users to allow propagation of credentials to other services.

@kfaraz kfaraz changed the title [Do Not Merge] Fix basic auth integration test Fix basic auth integration test Jan 14, 2024
Copy link
Copy Markdown
Contributor

@abhishekrb19 abhishekrb19 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @kfaraz! I've one question, but I will merge the change to unblock IT failures in master


// Add a delay to allow propagation of credentials to all services
try {
Thread.sleep(5000);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we know what changed here recently in auth land that this sleep is required? At any rate, I wonder if we could poll /status and/or issue a similar API call to verify things are setup instead of a static sleep.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, we recently introduced caching for basic auth in PR #15648 . That has sped up the authentication process triggering the flakiness in this test.

Only the coordinator exposes such APIs which can be used to fetch auth status, and indeed that API would return the expected response right away. The issue is the propagation of the creds from coordinator to other services (broker in this case) which may be delayed. Other services don't expose any API that would indicate the current set or version of auth creds that they have cached.

try {
Thread.sleep(5000);
}
catch (Throwable t) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
catch (Throwable t) {
catch (InterruptedException e) {

@abhishekrb19 abhishekrb19 merged commit f0c552b into apache:master Jan 14, 2024
@kfaraz kfaraz deleted the fix_auth_it branch January 14, 2024 17:17
@kfaraz
Copy link
Copy Markdown
Contributor Author

kfaraz commented Jan 14, 2024

Thanks a lot for the review, @abhishekrb19 !

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.

3 participants