Skip to content

Commit 7090bd8

Browse files
committed
Fix flaky grbs007 clickData race; mark dvcv003 flaky
grbs007: the clickData callback also fires on load with clickData=None, setting the textarea to "null". The test read the value right after the click and raced that initial value - data != "" passed but json.loads returned None. Wait for the real click payload before parsing. dvcv003: the devtools error overlay intermittently reports an empty error title under React 19; mark it @flaky(max_runs=3), matching the existing convention for these overlay tests in this file (dvcv013).
1 parent cf32d18 commit 7090bd8

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎components/dash-core-components/tests/integration/graph/test_graph_basics.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,16 @@ def handleClick(clickData):
365365

366366
dash_dcc.find_elements("g .xy")[0].click()
367367

368-
data = dash_dcc.wait_for_element("#test-text-area").get_attribute("value")
368+
# The clickData callback also fires once on load with clickData=None (value
369+
# "null"); wait for the click's real payload before parsing, otherwise we
370+
# race that initial value and json.loads returns None.
371+
wait.until(
372+
lambda: (dash_dcc.find_element("#test-text-area").get_attribute("value") or "")
373+
not in ("", "null"),
374+
timeout=3,
375+
)
376+
377+
data = dash_dcc.find_element("#test-text-area").get_attribute("value")
369378
assert data != "", "graph clickData must contain data"
370379

371380
data = json.loads(data)

‎tests/integration/devtools/test_callback_validation.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def x(a):
140140
check_errors(dash_duo, specs)
141141

142142

143+
@flaky(max_runs=3)
143144
def test_dvcv003_duplicate_outputs_same_callback(dash_duo):
144145
app = Dash(__name__)
145146
app.layout = html.Div([html.Div(id="a"), html.Div(id="b")])

0 commit comments

Comments
 (0)