Hi, On 05.10.2010 10:37, Bertrand Delacretaz wrote: > On Sun, Oct 3, 2010 at 9:45 AM, <[email protected]> wrote: >> Author: fmeschbe >> Date: Sun Oct 3 07:45:53 2010 >> New Revision: 1003926 >> ... >> Modified: >> >> sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletVersionableTest.java >> ... >> @Override >> protected void setUp() throws Exception { >> + // enable autoCheckout for the tests >> ... >> + assertPostStatus(CFG_URL, 302, config, null); >> ... >> + Thread.sleep(500); // give async config update some time > > Isn't there a better way, like rereading the config to make sure it's > been updated? > > This looks fragile, and will slow down the tests.
Yes, it will certainly slow down. But the point is not writing the config back to persistence which is synchronous. We have to wait for the configuration to propagate to the Sling Post Servlet and for the Sling Post Servlet to restart. This is asynchronous. AFAICT there is no good (non-intrusive) way to find out whether the Sling Post Servlet has been updated with the correct configuration. As a workaround, we could update the configuration in the test methods depending on this configuration instead of doing it in the setUp method for all tests (even though setUp is definitely the right place for this). Or is there a way to push the configuration before any of the PostServletVersionableTest tests run and to remove the configuration again after the PostServletVersionableTest tests have run ? Regards Felix > > -Bertrand >
