sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-discovery-oak] 07/12: SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync no async events are still in the queue. This is achieved by enqueueing an async event too that once it gets triggered ensures that no async events are left. This mechanism ensures that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING - and only that guarantees that the syncToken mechanism carries a high guarantee.
Date Tue, 07 Nov 2017 09:27:42 GMT
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.oak-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-oak.git

commit e2707dd58c8e0516e7b7e66f23e796a996bf6c38
Author: Stefan Egli <stefanegli@apache.org>
AuthorDate: Fri Oct 23 11:28:24 2015 +0000

    SLING-5094 / SLING-5173 / SLING-4603 related : ensure that before invoking the ConsistencyService.sync
no async events are still in the queue. This is achieved by enqueueing an async event too
that once it gets triggered ensures that no async events are left. This mechanism ensures
that before the syncToken is written, all TopologyEventListeners have received a TOPOLOGY_CHANGING
- and only that guarantees that the syncToken mechanism carries a high guarantee.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/oak@1710175
13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/discovery/oak/OakDiscoveryServiceTest.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/apache/sling/discovery/oak/OakDiscoveryServiceTest.java b/src/test/java/org/apache/sling/discovery/oak/OakDiscoveryServiceTest.java
index 7affca5..d5610fc 100644
--- a/src/test/java/org/apache/sling/discovery/oak/OakDiscoveryServiceTest.java
+++ b/src/test/java/org/apache/sling/discovery/oak/OakDiscoveryServiceTest.java
@@ -104,12 +104,12 @@ public class OakDiscoveryServiceTest {
         DescriptorHelper.setDiscoveryLiteDescriptor(builder.getResourceResolverFactory(),

                 discoBuilder);
         discoveryService.handlePotentialTopologyChange();
-        assertTrue(discoveryService.getViewStateManager().waitForAsyncEvents(2000));
+        assertEquals(0, discoveryService.getViewStateManager().waitForAsyncEvents(2000));
         assertEquals(1, listener.countEvents());
         discoveryService.unbindTopologyEventListener(listener);
         assertEquals(1, listener.countEvents());
         discoveryService.bindTopologyEventListener(listener);
-        assertTrue(discoveryService.getViewStateManager().waitForAsyncEvents(2000));
+        assertEquals(0, discoveryService.getViewStateManager().waitForAsyncEvents(2000));
         assertEquals(2, listener.countEvents()); // should now have gotten an INIT too
     }
     

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message