You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ge...@apache.org on 2021/07/15 03:33:41 UTC
[spark] branch branch-3.2 updated: [SPARK-36037][SQL][FOLLOWUP] Fix
flaky test for datetime function localtimestamp
This is an automated email from the ASF dual-hosted git repository.
gengliang pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new 83b37df [SPARK-36037][SQL][FOLLOWUP] Fix flaky test for datetime function localtimestamp
83b37df is described below
commit 83b37dfaf0090c41992a63412ed2e412f69eef5a
Author: Gengliang Wang <ge...@apache.org>
AuthorDate: Thu Jul 15 11:32:18 2021 +0800
[SPARK-36037][SQL][FOLLOWUP] Fix flaky test for datetime function localtimestamp
### What changes were proposed in this pull request?
The threshold of the test case "datetime function localtimestamp" is small, which leads to flaky test results
https://github.com/gengliangwang/spark/runs/3067396143?check_suite_focus=true
This PR is to increase the threshold for checking two the different current local datetimes from 5ms to 1 second. (The test case of current_timestamp uses 5 seconds)
### Why are the changes needed?
Fix flaky test
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Unit test
Closes #33346 from gengliangwang/fixFlaky.
Authored-by: Gengliang Wang <ge...@apache.org>
Signed-off-by: Gengliang Wang <ge...@apache.org>
(cherry picked from commit 0973397721a1172710c28376a7957d30ed8cbcad)
Signed-off-by: Gengliang Wang <ge...@apache.org>
---
.../spark/sql/catalyst/expressions/DateExpressionsSuite.scala | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
index 93fc775..dbfe0af 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
@@ -98,10 +98,10 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
test("datetime function localtimestamp") {
outstandingTimezonesIds.foreach { zid =>
+ val zoneId = DateTimeUtils.getZoneId(zid)
val ct = LocalTimestamp(Some(zid)).eval(EmptyRow).asInstanceOf[Long]
- val t1 = DateTimeUtils.localDateTimeToMicros(
- LocalDateTime.now(DateTimeUtils.getZoneId(zid)))
- assert(math.abs(t1 - ct) < 5000)
+ val t1 = DateTimeUtils.localDateTimeToMicros(LocalDateTime.now(zoneId))
+ assert(math.abs(t1 - ct) < 1000000)
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org