Skip to content

Commit cfaceb2

Browse files
committed
Wait for grants on anonymous function too
1 parent ed4f5fd commit cfaceb2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/integration/hive_metastore/test_grant_detail.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ def wait_for_grants(condition: Callable[[Iterable[Grant]], bool], **kwargs) -> N
6262
if not condition(grants):
6363
raise ValueError("Grants do not meet condition")
6464

65-
def contains_select_on_any_file(grants: Iterable[Grant]) -> bool:
65+
def grants_contain_select_action(grants: Iterable[Grant]) -> bool:
6666
"""Check if the SELECT permission on ANY FILE is present in the grants."""
6767
return any(g.principal == group.display_name and g.action_type == "SELECT" for g in grants)
6868

6969
# Wait for the grants to be available so that we can snapshot them.
70-
# Only verifying the SELECT permission on ANY FILE as it takes a while to propagate.
71-
wait_for_grants(contains_select_on_any_file, any_file=True)
70+
# Only verifying the SELECT permission on ANY FILE and ANONYMOUS FUNCTION as those take a while to propagate.
71+
wait_for_grants(grants_contain_select_action, any_file=True)
72+
wait_for_grants(grants_contain_select_action, anonymous_function=True)
7273

7374
runtime_ctx.grants_crawler.snapshot()
7475

0 commit comments

Comments
 (0)