Stabilize test on Windows (no-issue-check)

This commit is contained in:
Anthony Leonardo Gracio
2024-01-31 17:04:21 +00:00
parent 6387a01858
commit 709783a93b
2 changed files with 4 additions and 20 deletions

View File

@@ -1 +0,0 @@
gnatstudio.png

View File

@@ -7,26 +7,11 @@ from gs_utils.internal.utils import *
@run_test_driver
def test_driver():
yield wait_tasks()
b = GPS.EditorBuffer.get(GPS.File("m.adb"))
b.select(GPS.EditorLocation(b, 6, 45), GPS.EditorLocation(b, 6, 45))
yield timeout(500)
yield wait_tasks()
GPS.execute_action("Find All References")
task_hud_label = get_widget_by_name("task_hud_label")
label = ""
count = 0
# wait_until_true() has a granularity of 500ms, so it might miss
# the label update if it's shorter than this granularity. So use
# a manual loop instead.
while label == "":
label = task_hud_label.get_text()
if "[Ada]" in label:
break
count += 1
if count > 200:
break
yield timeout(10)
gps_assert(label, "[Ada] querying references",
"Wrong task label after 'find all references'")
tasks_labels = [task.label() for task in GPS.Task.list()]
gps_assert("[Ada] querying references" in tasks_labels, True,
"Wrong task label after 'find all references': %s" % str(tasks_labels))