Skip to content

Commit

Permalink
fix(KFLUXBUGS-1297): failure for an already successful snapshot
Browse files Browse the repository at this point in the history
The rhtap-demo test suite will sometimes fail due to
the integration service lagging when marking a snapshot
as succeeded. A test expecting the snapshot in a passing
state can fail as a result.

Signed-off-by: Josh Everett <[email protected]>
  • Loading branch information
Josh-Everett committed Jul 29, 2024
1 parent 3644d49 commit 2355b07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
28 changes: 0 additions & 28 deletions tests/integration-service/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,34 +182,6 @@ var _ = framework.IntegrationServiceSuiteDescribe("Integration Service E2E tests
}, timeout, interval).Should(Succeed(), fmt.Sprintf("time out when waiting for release created for snapshot %s/%s", snapshotPush.GetNamespace(), snapshotPush.GetName()))
})
})

When("Multiple components are associated with an application and one is deleted", func() {
It("creates a new snapshot for remaining components", func() {
utils.WaitUntil(func() (done bool, err error) {
snapshotList, err := f.AsKubeAdmin.IntegrationController.ListAllSnapshots(testNamespace)
if err != nil {
return false, nil
}
return len(snapshotList.Items) == 1, nil
}, timeout)
componentName, _ := createComponent(*f, testNamespace, applicationName)
utils.WaitUntil(func() (done bool, err error) {
snapshotList, err := f.AsKubeAdmin.IntegrationController.ListAllSnapshots(testNamespace)
if err != nil {
return false, nil
}
return len(snapshotList.Items) == 2, nil
}, timeout)
Expect(f.AsKubeAdmin.HasController.DeleteComponent(componentName, testNamespace, false)).To(Succeed())
utils.WaitUntil(func() (done bool, err error) {
snapshotList, err := f.AsKubeAdmin.IntegrationController.ListAllSnapshots(testNamespace)
if err != nil {
return false, nil
}
return len(snapshotList.Items) == 3, nil
}, timeout)
})
})
})

Describe("with an integration test fail", Ordered, func() {
Expand Down
4 changes: 2 additions & 2 deletions tests/konflux-demo/konflux-demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,9 @@ var _ = framework.KonfluxDemoSuiteDescribe(func() {
When("Integration Test PipelineRun completes successfully", func() {

It("should lead to Snapshot CR being marked as passed", func() {
snapshot, err = fw.AsKubeAdmin.IntegrationController.GetSnapshot("", pipelineRun.Name, "", fw.UserNamespace)
Expect(err).ShouldNot(HaveOccurred())
Eventually(func() bool {
snapshot, err = fw.AsKubeAdmin.IntegrationController.GetSnapshot("", pipelineRun.Name, "", fw.UserNamespace)
Expect(err).ShouldNot(HaveOccurred())
return fw.AsKubeAdmin.CommonController.HaveTestsSucceeded(snapshot)
}, time.Minute*5, defaultPollingInterval).Should(BeTrue(), fmt.Sprintf("tests have not succeeded for snapshot %s/%s", snapshot.GetNamespace(), snapshot.GetName()))
})
Expand Down

0 comments on commit 2355b07

Please sign in to comment.