This repository has been archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restart the watcher when there is an error sometimes
[#76989538] Signed-off-by: Johannes Tuchscherer <jtuchscherer@pivotallabs.com>
- Loading branch information
John Tuley
committed
Aug 15, 2014
1 parent
7e6ea91
commit 0a5bce3
Showing
4 changed files
with
113 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package store_test | ||
|
||
import ( | ||
"errors" | ||
. "github.com/cloudfoundry/loggregatorlib/store" | ||
"github.com/cloudfoundry/loggregatorlib/store/cache" | ||
"github.com/cloudfoundry/storeadapter" | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
"sync" | ||
) | ||
|
||
var _ = Describe("AppServiceStoreWatcherUnit", func() { | ||
Context("when there is an error", func() { | ||
var adapter *FakeAdapter | ||
|
||
BeforeEach(func() { | ||
adapter = &FakeAdapter{} | ||
watcher, _, _ := NewAppServiceStoreWatcher(adapter, cache.NewAppServiceCache()) | ||
|
||
go watcher.Run() | ||
}) | ||
|
||
It("calls watch again", func() { | ||
Eventually(adapter.GetWatchCounter).Should(Equal(1)) | ||
adapter.WatchErrChannel <- errors.New("Haha") | ||
Eventually(adapter.GetWatchCounter).Should(Equal(2)) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters