(dash_duo, dev_tools, store)
| 107 | ], |
| 108 | ) |
| 109 | def test_compute_graph_timing(dash_duo, dev_tools, store): |
| 110 | app = make_app() |
| 111 | dash_duo.start_server(app, **dev_tools) |
| 112 | times = [] |
| 113 | for _ in range(10): |
| 114 | dash_duo.wait_for_element("#input") |
| 115 | wait.until( |
| 116 | lambda: dash_duo.find_element("#output").text.strip() != "", timeout=4 |
| 117 | ) |
| 118 | graph_compute_time = float( |
| 119 | dash_duo.driver.execute_script( |
| 120 | "return window.dash_component_api.callbackGraphTime" |
| 121 | ) |
| 122 | ) |
| 123 | times.append(graph_compute_time) |
| 124 | dash_duo.driver.refresh() |
| 125 | avg_time = sum(times) / len(times) if times else 0 |
| 126 | check_timing[store] = avg_time |
| 127 | if store == "enabled": |
| 128 | print(f"Average time with store enabled: {avg_time:.2f} ms") |
| 129 | assert ( |
| 130 | check_timing["disabled"] < avg_time |
| 131 | ), "Expected faster performance with circular callback check disabled" |
| 132 | if store == "disabled": |
| 133 | print(f"Average time with store disabled: {avg_time:.2f} ms") |
| 134 | assert ( |
| 135 | avg_time < 200 |
| 136 | ), "Expected average time to be under 100 ms with circular callback check disabled" |
nothing calls this directly
no test coverage detected
searching dependent graphs…