Giter VIP home page Giter VIP logo

Comments (9)

dwarakaprasad avatar dwarakaprasad commented on May 23, 2024 2

We use ContextCustomizerFactory which is not compatible with context reuse.

Yup exactly, was having some fun looking at spring docs and sprint-test context cache implementation. The lambda that is being returned from SqlTestContainersSpringContextCustomizerFactory seem to be throwing the hashcode which is causing the context recreation.

I am trying to replace the lambda with an object and see how the cache reacts...
Will keep you posted...

from generator-jhipster.

dwarakaprasad avatar dwarakaprasad commented on May 23, 2024 1

@mshima, I am willing to contribute to this issue and have been doing some reading,
context-reload-sof
github issue related to this

Based on spring.io, contexts are cached and re-used as long as context configuration remains unique. I am trying to figure out what this really means from jhipter's backend implementation.

Let me know if you like me to move forward, I see you have made some changes too...

from generator-jhipster.

mshima avatar mshima commented on May 23, 2024

@dwarakaprasad great.
I would say that #21853 is the start point.
We use ContextCustomizerFactory which is not compatible with context reuse.

from generator-jhipster.

mshima avatar mshima commented on May 23, 2024

That's interesting, we should calculate the hashcode in customizers then.

from generator-jhipster.

dwarakaprasad avatar dwarakaprasad commented on May 23, 2024

@mshima ng-default with h2 dev has got about 20 - 30 sec faster (from 13 to 5 re-loads). See reference.

You can drop the DirtiesContext from AuthenticationIntegrationTest.java as well.

For some reason your changes does not seem to show any loading optimization.

from generator-jhipster.

dwarakaprasad avatar dwarakaprasad commented on May 23, 2024

For some reason your changes does not seem to show any loading optimization

got it, the returned ContextCustomizer needs the overridden hashCode method, your impl seems to be adding it to the ContextCustomizerfactory rather. See my reference impl.

from generator-jhipster.

mshima avatar mshima commented on May 23, 2024

With the ContextCustomizer hashCode in place the hash conflict is happing in ImportsContextCustomizer.
ImportsContextCustomizer is quite complex and hard to debug.
I give up for now.

from generator-jhipster.

mshima avatar mshima commented on May 23, 2024

Maybe it's related on how the TestContainerCustomizer is implemented.

from generator-jhipster.

dwarakaprasad avatar dwarakaprasad commented on May 23, 2024

Maybe it's related on how the TestContainerCustomizer is implemented.

I was able to get the non-testContainer based test ("devDatabaseType": "h2Memory") to be loaded optimally (see this), but not for the one using testContainers. I am getting 'liquibase' bean creation error as the spring.dataSource.url seems to be going in as null from TestContainerCustomizer, i.e. the DatasourceProperties object in the LiquibaseConfiguration.java is empty and nothing from the Customizer is propagated.

from generator-jhipster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.