Skip to content

Commit

Permalink
Merge pull request apache#36 from ashangit/SPARK-19050
Browse files Browse the repository at this point in the history
[SPARK-19050][SS][TESTS] Fix EventTimeWatermarkSuite 'delay in months and years handled correctly'
  • Loading branch information
ashangit authored Apr 24, 2017
2 parents 9b00856 + 9b2214c commit 6cf56a4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Loggin
assertEventStats { e =>
assert(timestampFormat.parse(e.get("max")).getTime === (currentTimeMs / 1000) * 1000)
val watermarkTime = timestampFormat.parse(e.get("watermark"))
assert(monthsSinceEpoch(currentTime) - monthsSinceEpoch(watermarkTime) === 29)
val monthDiff = monthsSinceEpoch(currentTime) - monthsSinceEpoch(watermarkTime)
// monthsSinceEpoch is like `math.floor(num)`, so monthDiff has two possible values.
assert(monthDiff === 29 || monthDiff === 30,
s"currentTime: $currentTime, watermarkTime: $watermarkTime")
}
)
}
Expand Down

0 comments on commit 6cf56a4

Please sign in to comment.