-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Couchbase tests are failing #13544
Comments
Nothing new here, @mraible See this ticket too: #12300 |
It's now a migration issue. We need to upgrade to Spring Data Couchbase 4.x. https://docs.spring.io/spring-data/couchbase/docs/4.1.3/reference/html/#couchbase.migrating |
If you have issues with contributing to my pull request, please let me know. I'd be happy to make it part of JHipster's repo instead of my fork. |
There is another unfinished pr from murdos #11845 |
Hi! I have been looking into the failing test and I think I found at least a couple problems that seem to be the root cause of these failing tests. The first one is that the default scan consistency in Spring Data Repository is set to NOT_BOUNDED. This mean that for every write we sent to CB, the response is immediate (we don't wait for the documents to be indexed). If we issue a read immediately after we get inconsistent results.
The other issue I found seems to be related with how Spring Data generates the queries from the repositories.in
and then it makes a request to fetch the document by "reset_key". The method to fetch is defined in the UserRepository.java as:
Now, the statement executed in Couchbase is:
Notice that the attribute is "resetKey" and not "reset_key" which cause the method to return no results and fail the test. The same happen with other tests that fetch for "activationKey". One of the things we can try is to get the latest spring data couchbase version and see if it is fixed there. I am not very familiar with the Jhipster internals and need to do some more digging to check where the dependency versions are defined to bring the lastes or just modify the pom file and force the last version there. Ill give it a try tonight. |
@mmonti You are correct in your scan consistency theory. I've been adding the annotation you mention on all the Your other finding about key names is interesting. We're currently using |
@mmonti I created a couple of repos from my branch so you can see the test failures. If you run You can also run them and see that e2e tests pass.
|
Hi @mraible, thanks for the repos! TLDR; all tests passed... :) I mainly worked on a fork of https://github.com/mraible/ngx-couchbase and focus again on the failing integration tests. I found the root cause of the issue I mentioned earlier (the one with spring data generating the wrong query for fields with @field annotations). The fix seems to be pretty simple in Spring Data (N1qlQueryCreator.java). In that converter of using getName() on source we need to change that to getFieldName() which has the logic to check for @field annotation and obtain the value from it in case it is present or fallback to getName() through fieldNameStrategy if not. I extended the Spring Data Couchbase Repository infrastructure to test this, and fixed a couple more tests of the 6 remaining. I am planning on creating a PR in your repo so you can take a look and give it a try. I will also try to look into Spring Data project to see if that issue is already reported and if not try to contribute that fix. Now, there were a couple more Integration tests that failed after my fix and are related with other "new issues" that I discovered.
This method generates:
which seems OK and straightforward for any DB but in Couchbase, IDs are treated in a different way and they need to be accessed through the metadata object. So the query that method should generate, should be something like:
I did succeed fixing this in Spring Data N1qlQueryCreator (in the same Converter lambda mentioned earlier) but the fix is more involved since we also need to tweak the QueryCriteria class (there is some escaping with backticks in that class that needs to be handled). This is because they provide the @query annotation and we can just annotate that method and add the behavior we want. Of course this needs to be changed in the JHipster Generator. Anyways, It would be nice to double check with them. The other test that fails is:
and this one is also related with a repository method, but in this case I believe that is because the Couchbase implementation does not support the "IgnoreCase" in:
This method generates the follow query:
and in Couchbase we should have something like:
I think that we can probably solve this test changing the JHipster Generator and change the method name if the database is couchbase or just use a @query annotation directly in the method. I actually fixed it in my fork with @query:
With all these changes in ngx-couchbase, all tests passed and we should pretty good to retry the build. Anyways, I still need to check if these fixes are valid also for the reactive version. Will try to look into during this week. |
Ohh dang!... I feel that i did all this debugging for issues that were already addressed!... 🤦♂️ 😂 I should have browse the PRs/Issues first in Spring Data Couchbase. Anyways, I am glad that DATACOUCH-1055 is already merged. I think that with that fix in, we can work out the rest on JHipster side. |
@mmonti I updated the webflux-couchbase example after incorporating your fixes. There are some tests failing. See details at #13770 (comment). |
@mraible thanks!... I started to look into the reactive implementation but didn't make much progress yet. I will try to work on it in the next few days. |
I see several test failures related to pagination. The reactive pagination support is... unstable. |
This issue is stale because it has been open 30 days with no activity. |
I'm hopeful we'll be able to fix these issues for v7. If not, there's this PR to disable the prompt for Couchbase. It will still be an option if you use JDL. |
"The first one is that the default scan consistency in Spring Data Repository is set to NOT_BOUNDED. " |
"It seems to be a bug in Spring Data since the User entity it has a "Field" annotation with a value and Spring Data should use that value to generate the correct query." |
This issue is stale because it has been open 30 days with no activity. |
Hi @pascalgrimaud - I see this has been reopened - but it looks like the couchbase tests are passing. Please let me know if there is any other information. |
Yes, I reopen stale tickets, as they have been auto closed |
Overview of the issue
Failure seems to be caused by EJS issues.
Motivation for or Use Case
All our nightly builds on https://github.com/hipster-labs/jhipster-daily-builds should pass.
The text was updated successfully, but these errors were encountered: