[ 
https://issues.apache.org/jira/browse/SLING-8246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16785686#comment-16785686
 ] 

Robert Munteanu commented on SLING-8246:
----------------------------------------

Thanks for the patch [~yuansc] and sorry for taking so long to review.

Looking at the code, I think it does the right thing - the ITs should only 
start when all bundles are started as well. However, we may be able to find a 
proper solution for you by allowing certain bundles to not be considered 
mandatory for the ITs to start.

In the {{TestManagerImpl}} that you already patches there is this block of code

{code:java}            final Set<Bundle> bundlesToWaitFor = new 
HashSet<Bundle>();
            for (final Bundle bundle : bundleContext.getBundles()) {
                if (bundle.getState() != Bundle.ACTIVE && !isFragment(bundle)) {
                    bundlesToWaitFor.add(bundle);
                }
            }{code}

We could make a list of bundles to exclude from this check, configurable, and 
then you can add the bundles you want skipped to this list in your tests. Would 
that work for you?

Also - if you prefer - you can also submit pull requests via 
https://github.com/apache/sling-org-apache-sling-junit-core, this way review is 
simpler and you get proper attribution for your contribution.

> Server side test hang with repeat "Waiting for the following bundles to 
> start:..." in log
> -----------------------------------------------------------------------------------------
>
>                 Key: SLING-8246
>                 URL: https://issues.apache.org/jira/browse/SLING-8246
>             Project: Sling
>          Issue Type: Improvement
>          Components: Apache Sling Testing Clients, JUnit Core
>    Affects Versions: JUnit Core 1.0.20, JUnit Core 1.0.22, JUnit Core 1.0.23, 
> JUnit Core 1.0.24, JUnit Core 1.0.26
>         Environment: OS: Windows, Linux
> Java:  Java 1.8
>            Reporter: Scott Yuan
>            Priority: Major
>         Attachments: patch.diff
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> +SLING-6334 - Server-Side Tests: Wait until all bundles are started be…+ had 
> been a great feature for ensuring accurate test results. Thanks for having 
> this feature available.
> I recently found that if there is a bundle failed to start; SLING-6334 
> doesn't timeout after DEFAULT_SYSTEM_STARTUP_INACTIVITY_TIMEOUT_SECONDS but 
> waits infinitely with repeating log message
> {noformat}
> 26.01.2019 13:58:14.562 *INFO* [qtp980475582-2859] 
> org.apache.sling.junit.impl.TestsManagerImpl Waiting for the following 
> bundles to start: [adobe-aemfd-signatures [777], 
> com.ags.forms.commom.ags_forms_common [854]]
> {noformat}
> In my case, we needed the server side tests continue to work while the bundle 
> starting problem being addressed in parallel. With some studies to the source 
> code, the issue can be fixed by a single liner change in the attached .diff 
> file.
> Hopefully, the problem can be addressed in the upcoming 1.0.27 release.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to