better checks for asqldb tests
@@ -92,7 +92,7 @@ func TestAzureSqlDatabaseControllerHappyPath(t *testing.T) {
Eventually(func() bool {
_ = tc.k8sClient.Get(ctx, sqlDatabaseNamespacedName, sqlDatabaseInstance)
- return sqlDatabaseInstance.IsSubmitted()
+ return sqlDatabaseInstance.Status.Provisioned
}, tc.timeout, tc.retry,
).Should(BeTrue())
@@ -100,8 +100,8 @@ func TestAzureSqlDatabaseControllerHappyPath(t *testing.T) {
//Expect(err).NotTo(HaveOccurred()) //Commenting as this call is async and returns an asyncopincomplete error
Eventually(func() bool {
- _ = tc.k8sClient.Get(ctx, sqlDatabaseNamespacedName, sqlDatabaseInstance)
- return helpers.IsBeingDeleted(sqlDatabaseInstance)
+ err = tc.k8sClient.Get(ctx, sqlDatabaseNamespacedName, sqlDatabaseInstance)
+ return apierrors.IsNotFound(err)
}, tc.timeout, tc.retry,
).Should(BeTrue())
@@ -110,8 +110,8 @@ func TestAzureSqlDatabaseControllerHappyPath(t *testing.T) {
err = tc.k8sClient.Delete(ctx, sqlServerInstance)
Eventually(func() bool {
- _ = tc.k8sClient.Get(ctx, sqlServerNamespacedName, sqlServerInstance)
- return helpers.IsBeingDeleted(sqlServerInstance)
+ err = tc.k8sClient.Get(ctx, sqlServerNamespacedName, sqlServerInstance)
+ return apierrors.IsNotFound(err)
}, tc.timeout, tc.retry,
).Should(BeTrue())
