carloea2 commented on code in PR #8282:
URL: https://github.com/apache/texera/pull/8282#discussion_r4059713370


##########
amber/src/main/python/core/util/buffer/timed_buffer.py:
##########
@@ -36,7 +36,7 @@ def get(self, flush: bool = False) -> 
Iterator[ConsoleMessage]:
         if (
             flush
             or len(self._buffer) >= self._max_message_num
-            or (datetime.now() - self._last_output_time).seconds
+            or (datetime.now() - self._last_output_time).total_seconds()

Review Comment:
   Switched to monotonic time in 5c55c869e2. The backward wall-clock regression 
failed before the change and now passes.



##########
amber/src/test/python/core/util/buffer/test_timed_buffer.py:
##########
@@ -129,9 +129,15 @@ def test_exceeding_max_message_num_triggers_flush(self, 
clock):
 
 
 class TestFlushOnTime:
+    def test_subsecond_interval_triggers_flush(self, clock):

Review Comment:
   Added the 400 ms withholding case alongside the 500 ms flush case.



##########
amber/src/main/python/core/util/buffer/timed_buffer.py:
##########
@@ -36,7 +36,7 @@ def get(self, flush: bool = False) -> 
Iterator[ConsoleMessage]:
         if (
             flush

Review Comment:
   You're right. All five callers force a flush. I corrected the issue and PR 
description to describe the helper limitation, not a user-visible console 
delay. No caller changes are planned here.



##########
amber/src/main/python/core/util/buffer/timed_buffer.py:
##########
@@ -36,7 +36,7 @@ def get(self, flush: bool = False) -> 
Iterator[ConsoleMessage]:
         if (
             flush
             or len(self._buffer) >= self._max_message_num
-            or (datetime.now() - self._last_output_time).seconds
+            or (datetime.now() - self._last_output_time).total_seconds()
             >= self._max_flush_interval_in_ms / 1000

Review Comment:
   Updated the comment and both timer fixtures for the monotonic clock. All 21 
focused tests pass.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to