mengw15 commented on code in PR #6906:
URL: https://github.com/apache/texera/pull/6906#discussion_r3825209122
##########
amber/src/test/python/core/models/test_internal_queue.py:
##########
@@ -116,13 +116,6 @@ def test_it_accepts_all_recognized_element_types(
assert queue.is_empty()
Review Comment:
Done in 41b866a — removed the three NOTE lines.
##########
amber/src/test/python/core/models/test_internal_queue.py:
##########
@@ -116,13 +116,6 @@ def test_it_accepts_all_recognized_element_types(
assert queue.is_empty()
@pytest.mark.timeout(2)
- @pytest.mark.xfail(
- reason=(
- "LinkedBlockingMultiQueue.add_sub_queue does not currently insert
new "
- "priority groups ahead of lower-priority ones, so registering data
before "
- "control can break control-priority ordering."
- )
- )
def
test_control_elements_dequeue_before_data_even_if_data_channel_registered_first(
Review Comment:
Added `TestAddSubQueue` to test_linked_blocking_multi_queue.py in 41b866a:
all 24 registration orders of four priorities must produce a sorted
`priority_groups`, plus a same-priority-out-of-order case asserting the group
is shared. Both fail with the pre-fix `append`.
##########
amber/src/main/python/core/util/customized_queue/linked_blocking_multi_queue.py:
##########
@@ -421,9 +421,12 @@ def add_sub_queue(self, key: K, priority: int) ->
Optional[SubQueue]:
added = True
break
elif pg.priority > priority:
+ # pg has a lower priority than the new group, so the
new
+ # group belongs in front of it: priority_groups must
stay
+ # sorted because the selection strategy walks it in
order.
new_pg = self.PriorityGroup(priority)
new_pg.add_queue(sub_queue)
- self.priority_groups.append(new_pg)
+ self.priority_groups.insert(i, new_pg)
Review Comment:
Agreed — reproduced the `AttributeError` exactly as described on a repeated
key. Filed #7810 to track restoring the `putIfAbsent` semantics; leaving this
PR to the ordering fix.
--
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]