Skip to content

Commit

Permalink
fix: Fix experiment test
Browse files Browse the repository at this point in the history
Signed-off-by: Ce Gao <gaoce@caicloud.io>
  • Loading branch information
gaocegege committed Jun 12, 2019
1 parent 7143b05 commit 5252048
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
experimentName = "foo"
namespace = "default"

timeout = time.Second * 5
timeout = time.Second * 20
)

var expectedRequest = reconcile.Request{NamespacedName: types.NamespacedName{Name: experimentName, Namespace: namespace}}
Expand Down Expand Up @@ -89,7 +89,7 @@ func TestCreateExperiment(t *testing.T) {
}()

stopCh := make(chan struct{})
mgr.GetCache().WaitForCacheSync(stopCh)
g.Expect(mgr.GetCache().WaitForCacheSync(stopCh)).To(gomega.BeTrue())
defer func() {
close(stopCh)
}()
Expand Down
6 changes: 6 additions & 0 deletions pkg/controller/v1alpha2/trial/trial_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ func TestReconcileTFJobTrial(t *testing.T) {

stopMgr, mgrStopped := StartTestManager(mgr, g)

stopCh := make(chan struct{})
g.Expect(mgr.GetCache().WaitForCacheSync(stopCh)).To(gomega.BeTrue())
defer func() {
close(stopCh)
}()

defer func() {
close(stopMgr)
mgrStopped.Wait()
Expand Down

0 comments on commit 5252048

Please sign in to comment.