-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
test: new tables that don't use the scache are not immediately available #5121
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
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main idea here is:
notify pgrst) and obtain the name.I manually tested this with 120K tables (mentioned on #4462, same case as #4613) and was able to see the request failing with 404 for a good time. But for test speed 5000 was enough.
Also I load this bunch of tables on a procedure at the beginning to avoid slowing down the other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not look at the code at all, but this reads an awful lot like a test that will be heavily timing dependent... which I am really not looking forward to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I wasn't clear but no, there's no timing (no sleep call) in the test right now and won't expect it to be after the fix.
If #5120 is merged this is expected to pass as it is (without xfail).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"timing dependent" does not mean "it has a sleep call". It means that whether the test passes or fails depends on how fast the machine running the test operates.
Run this test on a machine that does not make "the scache load [...] slow" and you might not have the desired test result. That's the problematic timing dependence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test does accurately capture what #4613 is about.
To not make it timing dependent I guess we need to capture if a simple request like
/table?id=eq.1doesn't use the schema cache. For that we'd need some schema cache metric likeschema_cache_usebut it doesn't seem generally useful or worth it.Any other ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we just need to:
That should already show the "problem", right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this should be it. I am also confused on why we are creating a lot of tables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I can add a simpler test.
Although this simple test doesn't prove a subproblem of #4613, that is that with a big number of tables the scache load takes a good amount of time leading to that 404. If the number of tables was small this problem wouldn't be noticeable.
I added some setup code here to prove that and I think that's valuable but I can't see an immediate need for it.
So I'll just open a new PR and leave this one as is in case this setup can be reused later.