Skip to content

Commit 93fc13b

Browse files
mykaulvponomaryov
authored andcommitted
fix(wait_for_view_to_be_built): function did not return if only an index completed building
It seems that if we are checking that an only index has finished building (which will happen when we call the function from wait_for_index_to_be_built() function), then the code does add an INFO level log - but does not return. Unrelated, added a more detailed log - of the timeout value. Signed-off-by: Yaniv Kaul <[email protected]>
1 parent 8691403 commit 93fc13b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdcm/utils/nemesis_utils/indexes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,19 @@ def wait_for_index_to_be_built(node: BaseNode, ks, index_name, timeout=300) -> N
7575

7676

7777
def wait_for_view_to_be_built(node: BaseNode, ks, view_name, timeout=300) -> None:
78-
LOGGER.info('waiting for view/index %s to be built', view_name)
78+
LOGGER.info(f"waiting {timeout} seconds for view/index {view_name} to be built")
7979
start_time = time.time()
8080
while time.time() - start_time < timeout:
8181
result = node.run_nodetool(f"viewbuildstatus {ks}.{view_name}",
8282
ignore_status=True, verbose=False, publish_event=False)
8383
if f"{ks}.{view_name}_index has finished building" in result.stdout:
8484
InfoEvent(message=f"Index {ks}.{view_name} was built").publish()
85+
return
8586
if f"{ks}.{view_name} has finished building" in result.stdout:
8687
InfoEvent(message=f"View/index {ks}.{view_name} was built").publish()
8788
return
8889
time.sleep(30)
89-
raise TimeoutError(f"Timeout error while creating view/index {view_name}. "
90+
raise TimeoutError(f"Timeout error ({timeout} seconds) while creating view/index {view_name}.\n"
9091
f"stdout\n: {result.stdout}\n"
9192
f"stderr\n: {result.stderr}")
9293

0 commit comments

Comments
 (0)