File: 03-no-Awaitility.patch

package info (click to toggle)
apache-curator 5.7.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,996 kB
  • sloc: java: 53,996; xml: 2,358; python: 346; sh: 214; makefile: 2
file content (176 lines) | stat: -rw-r--r-- 7,547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
Description: the Awaitility classes are not packaged for Debian yet
Author: Pierre Gruet <pgt@debian.org>
Forwarded: not-needed
Last-Update: 2022-06-28

--- a/curator-client/src/test/java/org/apache/curator/BasicTests.java
+++ b/curator-client/src/test/java/org/apache/curator/BasicTests.java
@@ -38,8 +38,8 @@
 import org.apache.zookeeper.Watcher;
 import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.ZooKeeper;
-import org.awaitility.Awaitility;
 import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 public class BasicTests extends BaseClassForTests {
@@ -142,6 +142,7 @@
         }
     }
 
+    @Disabled("No Awaitility class in Debian")
     @Test
     public void testBackgroundConnect() throws Exception {
         final int CONNECTION_TIMEOUT_MS = 4000;
@@ -149,9 +150,6 @@
                 server.getConnectString(), 10000, CONNECTION_TIMEOUT_MS, null, new RetryOneTime(1))) {
             assertFalse(client.isConnected());
             client.start();
-            Awaitility.await()
-                    .atMost(Duration.ofMillis(CONNECTION_TIMEOUT_MS))
-                    .untilAsserted(() -> Assertions.assertTrue(client.isConnected()));
         }
     }
 }
--- a/curator-client/src/test/java/org/apache/curator/utils/TestCloseableExecutorService.java
+++ b/curator-client/src/test/java/org/apache/curator/utils/TestCloseableExecutorService.java
@@ -29,9 +29,9 @@
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
-import org.awaitility.Awaitility;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 public class TestCloseableExecutorService {
@@ -145,6 +145,7 @@
         assertEquals(service.size(), 0);
     }
 
+    @Disabled("no Awaitility class in Debian")
     @Test
     public void testPartialRunnable() throws InterruptedException {
         final CountDownLatch outsideLatch = new CountDownLatch(1);
@@ -165,7 +166,6 @@
             submitRunnable(service, startLatch, latch);
         }
 
-        Awaitility.await().until(() -> service.size() >= QTY);
 
         assertTrue(startLatch.await(3, TimeUnit.SECONDS));
         service.close();
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatcherIdentity.java
@@ -38,7 +38,7 @@
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.zookeeper.WatchedEvent;
 import org.apache.zookeeper.Watcher;
-import org.awaitility.Awaitility;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 public class TestWatcherIdentity extends BaseClassForTests {
@@ -81,6 +81,7 @@
         }
     }
 
+    @Disabled("no Awaitility class in Debian")
     @Test
     public void testSameWatcherPerZKDocs() throws Exception {
         CountZKWatcher actualWatcher = new CountZKWatcher();
@@ -97,12 +98,10 @@
 
             client.setData().forPath("/test", "foo".getBytes());
             client.delete().forPath("/test");
-            Awaitility.await().untilAsserted(() -> assertEquals(1, actualWatcher.count.getAndSet(0)));
 
             client.create().forPath("/test");
             client.checkExists().usingWatcher(actualWatcher).forPath("/test");
             client.delete().forPath("/test");
-            Awaitility.await().untilAsserted(() -> assertEquals(1, actualWatcher.count.get()));
         } finally {
             CloseableUtils.closeQuietly(client);
         }
@@ -171,6 +170,7 @@
         }
     }
 
+    @Disabled("No Awaitility class in Debian")
     @Test
     public void testZKWatcher() throws Exception {
         Timing timing = new Timing();
@@ -185,7 +185,6 @@
             client.getData().usingWatcher(watcher).forPath(PATH);
             // Ok, let's test it
             client.setData().forPath(PATH, new byte[] {});
-            Awaitility.await().untilAsserted(() -> assertEquals(1, watcher.count.get()));
         } finally {
             CloseableUtils.closeQuietly(client);
         }
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java
@@ -25,7 +25,6 @@
 import org.apache.curator.test.compatibility.Timing2;
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.zookeeper.ZooKeeper;
-import org.awaitility.Awaitility;
 
 public class TestCleanState {
     private static final boolean IS_ENABLED = Boolean.getBoolean("PROPERTY_VALIDATE_NO_REMAINING_WATCHERS");
@@ -38,11 +37,6 @@
         try {
             Timing2 timing = new Timing2();
             CuratorFrameworkImpl internalClient = (CuratorFrameworkImpl) client;
-            EnsembleTracker ensembleTracker = internalClient.getEnsembleTracker();
-            if (ensembleTracker != null) {
-                Awaitility.await().until(() -> !ensembleTracker.hasOutstanding());
-                ensembleTracker.close();
-            }
             ZooKeeper zooKeeper = internalClient.getZooKeeper();
             if (zooKeeper != null) {
                 final int maxLoops = 3;
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java
@@ -70,7 +70,7 @@
 import org.apache.curator.test.compatibility.CuratorTestBase;
 import org.apache.curator.test.compatibility.Timing2;
 import org.apache.curator.utils.CloseableUtils;
-import org.awaitility.Awaitility;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Tag;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
@@ -431,6 +431,7 @@
         }
     }
 
+    @Disabled("No Awaitility packaged in Debian")
     @Test
     public void testLeadershipElectionWhenNodeDisappearsAfterChildrenAreRetrieved() throws Exception {
         final String latchPath = "/foo/bar";
@@ -455,22 +456,10 @@
                 latchCandidate0.start();
 
                 final int expectedChildrenAfterCandidate0Joins = 2;
-                Awaitility.await("There should be " + expectedChildrenAfterCandidate0Joins
-                                + " child nodes created after candidate #0 joins the leader election.")
-                        .pollInterval(pollInterval)
-                        .pollInSameThread()
-                        .until(() ->
-                                client.getChildren().forPath(latchPath).size() == expectedChildrenAfterCandidate0Joins);
                 // no extra CountDownLatch needs to be set here because candidate #1 will rely on candidate #0
                 latchCandidate1.start();
 
                 final int expectedChildrenAfterCandidate1Joins = 3;
-                Awaitility.await("There should be " + expectedChildrenAfterCandidate1Joins
-                                + " child nodes created after candidate #1 joins the leader election.")
-                        .pollInterval(pollInterval)
-                        .pollInSameThread()
-                        .until(() ->
-                                client.getChildren().forPath(latchPath).size() == expectedChildrenAfterCandidate1Joins);
 
                 // triggers the removal of the corresponding child node after candidate #0 retrieved the children
                 latchInitialLeader.close();