Skip to content

Commit f19a66c

Browse files
committed
add more logs
Signed-off-by: Tiger Kaovilai <[email protected]>
1 parent 8e386bb commit f19a66c

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ test-e2e-ginkgo: test-e2e-setup
437437
-provider=$(CLUSTER_TYPE) \
438438
-creds_secret_ref=$(CREDS_SECRET_REF) \
439439
-artifact_dir=$(ARTIFACT_DIR) \
440-
-oc_cli=$(OC_CLI)
440+
-oc_cli=$(OC_CLI) \
441+
--ginkgo.timeout=2h
441442

442443
.PHONY: test-e2e
443444
test-e2e: volsync-install test-e2e-ginkgo

tests/e2e/dpa_deployment_suite_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ var _ = Describe("Configuration testing for DPA Custom Resource", func() {
648648
if len(dpa.Spec.Configuration.Velero.DefaultPlugins) > 0 {
649649
log.Printf("Checking for default plugins")
650650
for _, plugin := range dpa.Spec.Configuration.Velero.DefaultPlugins {
651-
Eventually(DoesPluginExist(namespace, plugin), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
651+
Eventually(DoesPluginExist(namespace, plugin), timeoutMultiplier*time.Minute*6, time.Second*5).Should(BeTrue())
652652
}
653653
}
654654

@@ -657,21 +657,23 @@ var _ = Describe("Configuration testing for DPA Custom Resource", func() {
657657
if len(dpa.Spec.Configuration.Velero.CustomPlugins) > 0 {
658658
log.Printf("Checking for custom plugins")
659659
for _, plugin := range dpa.Spec.Configuration.Velero.CustomPlugins {
660-
Eventually(DoesCustomPluginExist(namespace, plugin), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
660+
Eventually(DoesCustomPluginExist(namespace, plugin), timeoutMultiplier*time.Minute*6, time.Second*5).Should(BeTrue())
661661
}
662662
}
663-
663+
664+
log.Printf("Waiting for restic daemonset to have nodeselector")
664665
if dpa.Spec.Configuration.Restic != nil && dpa.Spec.Configuration.Restic.PodConfig != nil {
665666
for key, value := range dpa.Spec.Configuration.Restic.PodConfig.NodeSelector {
666667
log.Printf("Waiting for restic daemonset to get node selector")
667-
Eventually(ResticDaemonSetHasNodeSelector(namespace, key, value), timeoutMultiplier*time.Minute*3, time.Second*5).Should(BeTrue())
668+
Eventually(ResticDaemonSetHasNodeSelector(namespace, key, value), timeoutMultiplier*time.Minute*6, time.Second*5).Should(BeTrue())
668669
}
669670
}
670671
// wait at least 1 minute after reconciled
671672
Eventually(func() bool {
672673
//has it been at least 1 minute since reconciled?
674+
log.Printf("Waiting for 1 minute after reconciled: %v elapsed", time.Since(timeReconciled).String())
673675
return time.Now().After(timeReconciled.Add(time.Minute))
674-
}, timeoutMultiplier*time.Minute*3, time.Second).Should(BeTrue())
676+
}, timeoutMultiplier*time.Minute*5, time.Second*5).Should(BeTrue())
675677
adpLogsAfterOneMinute, err := GetOpenShiftADPLogs(dpaCR.Namespace)
676678
Expect(err).NotTo(HaveOccurred())
677679
// We expect adp logs to be the same after 1 minute

tests/e2e/lib/subscription_helpers.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,33 @@ func (d *DpaCustomResource) GetOperatorSubscription() (*Subscription, error) {
3535
return &Subscription{&sl.Items[0]}, nil
3636
}
3737

38+
func (s *Subscription) Refresh() error {
39+
cfg, err := config.GetConfig()
40+
if err != nil {
41+
return err
42+
}
43+
c, err := client.New(cfg, client.Options{})
44+
if err != nil {
45+
return err
46+
}
47+
return c.Get(context.Background(), types.NamespacedName{Namespace: s.Namespace, Name: s.Name}, s.Subscription)
48+
}
49+
3850
func (s *Subscription) getCSV() (*operators.ClusterServiceVersion, error) {
51+
err := s.Refresh()
52+
if err != nil {
53+
return nil, err
54+
}
55+
3956
client, err := client.New(config.GetConfigOrDie(), client.Options{})
4057
if err != nil {
4158
return nil, err
4259
}
4360
var installPlan operators.InstallPlan
61+
62+
if s.Status.InstallPlanRef == nil {
63+
return nil, errors.New("no install plan found in subscription")
64+
}
4465
err = client.Get(context.Background(), types.NamespacedName{Namespace: s.Namespace, Name: s.Status.InstallPlanRef.Name}, &installPlan)
4566
if err != nil {
4667
return nil, err
@@ -59,6 +80,7 @@ func (s *Subscription) CsvIsReady() bool {
5980
log.Printf("Error getting CSV: %v", err)
6081
return false
6182
}
83+
log.Default().Printf("CSV status phase: %v", csv.Status.Phase)
6284
return csv.Status.Phase == operators.CSVPhaseSucceeded
6385
}
6486
func (s *Subscription) CsvIsInstalling() bool {

0 commit comments

Comments
 (0)