Skip to content

Commit

Permalink
Merge pull request #1011 from nicolaferraro/997-optimize-watch
Browse files Browse the repository at this point in the history
  • Loading branch information
fusesource-ci authored Feb 15, 2018
2 parents 904609c + cda0330 commit 83eda0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ protected T periodicWatchUntilReady(int i, long started, long interval, long amo
}

ReadinessWatcher<T> watcher = new ReadinessWatcher<>(item);
try (Watch watch = watch(watcher)) {
try (Watch watch = watch(item.getMetadata().getResourceVersion(), watcher)) {
try {
return watcher.await(interval, TimeUnit.MILLISECONDS);
} catch (KubernetesClientTimeoutException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void testWaitUntilReady() throws InterruptedException {

server.expect().get().withPath("/api/v1/namespaces/test/pods/pod1").andReturn(200, noReady).once();

server.expect().get().withPath("/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&watch=true").andUpgradeToWebSocket()
server.expect().get().withPath("/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&resourceVersion=1&watch=true").andUpgradeToWebSocket()
.open()
.waitFor(500).andEmit(new WatchEvent(ready, "MODIFIED"))
.done()
Expand Down Expand Up @@ -190,7 +190,7 @@ public void testWaitUntilExistsThenReady() throws InterruptedException {
// and again so that "periodicWatchUntilReady" successfully begins
server.expect().get().withPath("/api/v1/namespaces/test/pods/pod1").andReturn(200, noReady).times(2);

server.expect().get().withPath("/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&watch=true").andUpgradeToWebSocket()
server.expect().get().withPath("/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&resourceVersion=1&watch=true").andUpgradeToWebSocket()
.open()
.waitFor(100).andEmit(new WatchEvent(ready, "MODIFIED"))
.done()
Expand Down Expand Up @@ -230,7 +230,7 @@ public void testCreateAndWaitUntilReady() throws InterruptedException {
server.expect().get().withPath("/api/v1/namespaces/test/pods/pod1").andReturn(200, noReady).times(2);
server.expect().post().withPath("/api/v1/namespaces/test/pods").andReturn(201, noReady).once();

server.expect().get().withPath("/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&watch=true").andUpgradeToWebSocket()
server.expect().get().withPath("/api/v1/namespaces/test/pods?fieldSelector=metadata.name%3Dpod1&resourceVersion=1&watch=true").andUpgradeToWebSocket()
.open()
.waitFor(100).andEmit(new WatchEvent(ready, "MODIFIED"))
.done()
Expand Down

0 comments on commit 83eda0c

Please sign in to comment.