-
Notifications
You must be signed in to change notification settings - Fork 111
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
Figure out possible problem with sqlite3mc and the heap_limit functions #564
Comments
cc/ @utelle |
FWIW, I get the same error when running the test suite in my local dev environment, on a Mac. |
|
I inspected SQLite's code and the test code. SQLite has a data structure which holds the soft and the hard heap limit. Both values are initialized to 0, unless the symbol That is, SQLite starts with soft and hard heap limit equal 0. However, obviously the first call to So, if Another question is, under which circumstances can it happen, that Now, how can the hard heap limit have the value of 10485760? This has to be the case. Otherwise you would not get this value back on querying for the actual soft heap limit value on the first call. The answer can only be that the hard heap limit test (which is also included in the test suite) ran ** before** the soft heap limit test. If this is the case, the result of the soft heap limit test can be explained easily: When a new soft heap limit of 20971520 is requested, the value is checked against the hard heap limit value (which is 10485760). Because this value is smaller than the new requested soft heap limit, the soft heap limit is set to the value of the hard heap limit. And that's why the second query of the soft heap limit returns 10485760 instead of the expected value 20971520. My explanation is that the hard heap limit test runs before the soft heap limit test, causing the observed results. What I can't explain is, why this happens only for However, I'm quite confident that it has nothing to do with |
Nice detective work. I tried changing both tests to reset their limits back to 0 after doing their checks. That seems to fix the problem. |
…avoid problems with the tests being run out of order. #564
Please do the following: Add this call at the beginning of the test var previousHardLimit = raw.sqlite3_hard_heap_limit64(0); This way you should get a clean initial state, and the test should no longer fail. If possible show the value of |
I saw your post only after I submitted my previous one.
My specialty. 😄
I'm not surprised. 😆 |
During #563 there was a problem with the test cases involving heap_limit. These tests have been temporarily disabled, but need to be brought back.
The text was updated successfully, but these errors were encountered: