diff --git a/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split1/FaceSuite.scala b/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split1/FaceSuite.scala index bd0003a026..848c6636f0 100644 --- a/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split1/FaceSuite.scala +++ b/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split1/FaceSuite.scala @@ -278,7 +278,7 @@ class IdentifyFacesSuite extends TransformerFuzzing[IdentifyFaces] with Cognitiv try { val pgDateString = pgi.personGroupId.replaceFirst("group", "") val pgDate = LocalDateTime.parse(pgDateString, DateTimeFormatter.ofPattern(timeFormat)) - if (twoDaysAgo.compareTo(pgDate) <= 0) { + if (pgDate.isBefore(twoDaysAgo)) { PersonGroup.delete(pgi.personGroupId) println(s"deleted group $pgi") } diff --git a/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split4/MultivariateAnamolyDetectionSuite.scala b/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split4/MultivariateAnamolyDetectionSuite.scala index 9e3fed179a..e63db58686 100644 --- a/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split4/MultivariateAnamolyDetectionSuite.scala +++ b/cognitive/src/test/scala/com/microsoft/azure/synapse/ml/cognitive/split4/MultivariateAnamolyDetectionSuite.scala @@ -263,7 +263,7 @@ class FitMultivariateAnomalySuite extends EstimatorFuzzing[FitMultivariateAnomal models.foreach { modelId => val lastUpdated = MADUtils.madGetModel(url, modelId, anomalyKey).parseJson.asJsObject.fields("lastUpdatedTime") val lastUpdatedTime = stringToTime(lastUpdated.toString().replaceAll("\"", "")) - if (lastUpdatedTime.compareTo(twoDaysAgo) <= 0) { + if (lastUpdatedTime.isBefore(twoDaysAgo)) { println(s"Deleting $modelId") MADUtils.madDelete(modelId, anomalyKey, anomalyLocation) }