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

Modify TestDirectoryListCacheInvalidation to fix flakiness #22455

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

agrawalreetika
Copy link
Member

Description

Modify TestDirectoryListCacheInvalidation to fix flakiness

Motivation and Context

TestDirectoryListCacheInvalidation test was failing because caching catalog hivecached is shared with https://github.com/prestodb/presto/blob/master/presto-product-tests/src/main/java/com/facebook/presto/tests/hive/TestSymlinkTableListCaching.java So the initial existing assert https://github.com/prestodb/presto/blob/master/presto-product-tests/src/main/java/com/facebook/presto/tests/hive/TestDirectoryListCacheInvalidation.java#L45 may not be true if TestSymlinkTableListCaching is running first. Since the JMX for hitcount and misscount may already be populated as part of TestSymlinkTableListCaching

Impact

Fixes #22425

Test Plan

Contributor checklist

  • Please make sure your submission complies with our development, formatting, commit message, and attribution guidelines.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

@agrawalreetika agrawalreetika marked this pull request as ready for review April 9, 2024 13:45
@agrawalreetika agrawalreetika requested a review from a team as a code owner April 9, 2024 13:45
Copy link
Contributor

@tdcmeehan tdcmeehan left a comment

Choose a reason for hiding this comment

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

Is it ensured that the cluster under test has at most one test running against it?

Comment on lines 53 to 54
long hitCount1 = (long) result.row(0).get(0);
long missCount1 = (long) result.row(0).get(1);
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
long hitCount1 = (long) result.row(0).get(0);
long missCount1 = (long) result.row(0).get(1);
long hitCount = (long) result.row(0).get(0);
long missCount = (long) result.row(0).get(1);

@agrawalreetika
Copy link
Member Author

Is it ensured that the cluster under test has at most one test running against it?

You mean tests where hivecached is shared they are running at time on the cluster?

@tdcmeehan
Copy link
Contributor

Is it ensured that the cluster under test has at most one test running against it?

You mean tests where hivecached is shared they are running at time on the cluster?

Yes--can the query count metrics be influenced by any concurrent running queries?

@agrawalreetika
Copy link
Member Author

Is it ensured that the cluster under test has at most one test running against it?

You mean tests where hivecached is shared they are running at time on the cluster?

Yes--can the query count metrics be influenced by any concurrent running queries?

I think it could. Since here hitcount, missCount variable may not hold the value incremented by 1 which was captured here in https://github.com/prestodb/presto/pull/22455/files#diff-20e1ed420a5fd877893fcaacc97f3ad50d36e5ee71771a0d828a12c29dc19525R44. Since these metrics are for overall connector.

@tdcmeehan
Copy link
Contributor

@agrawalreetika does it make sense then, since these metrics may be influenced by other tests, to modify the assertions to check that the counts have updated by at least 1, instead of asserting hard equality on 1?

@agrawalreetika
Copy link
Member Author

@agrawalreetika does it make sense then, since these metrics may be influenced by other tests, to modify the assertions to check that the counts have updated by at least 1, instead of asserting hard equality on 1?

@tdcmeehan That would help us in such cases for the test not to fail but it could avoid the test on the actual tests since we wouldn't know if metrics are incremented with respective tests.
What about having 2 different caching catalogs for 2 tests, though this may not be efficient I think? WDYT

Else, we can update assertions to check that the counts have updated by at least 1 as you suggested earlier. LMK

@tdcmeehan
Copy link
Contributor

Having a dedicated catalog for this test actually makes a lot of sense to me.

@tdcmeehan tdcmeehan merged commit 0619997 into prestodb:master Apr 10, 2024
56 checks passed
@tdcmeehan
Copy link
Contributor

Thanks @agrawalreetika!

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.

TestDirectoryListCacheInvalidation.testDirectoryListCacheInvalidation flakes
3 participants