diff --git a/dash/_callback.py b/dash/_callback.py index 54a2e5a64c..7471ddea55 100644 --- a/dash/_callback.py +++ b/dash/_callback.py @@ -449,7 +449,9 @@ def add_context(*args, **kwargs): progress = callback_manager.get_progress(cache_key) if progress: response["progress"] = { - str(x): progress[i] for i, x in enumerate(progress_outputs) + str(x): progress[i] + for i, x in enumerate(progress_outputs) + if not isinstance(progress[i], NoUpdate) } output_value = callback_manager.get_result(cache_key, job_id) diff --git a/tests/integration/long_callback/app_progress_delete.py b/tests/integration/long_callback/app_progress_delete.py index 2fdf08af61..50926e6091 100644 --- a/tests/integration/long_callback/app_progress_delete.py +++ b/tests/integration/long_callback/app_progress_delete.py @@ -1,4 +1,4 @@ -from dash import Dash, Input, Output, State, html, clientside_callback +from dash import Dash, Input, Output, State, html, clientside_callback, no_update import time from tests.integration.long_callback.utils import get_long_callback_manager @@ -16,6 +16,7 @@ html.Div(0, id="progress-counter"), ] ) +app.test_lock = lock = long_callback_manager.test_lock clientside_callback( "function(_, previous) { return parseInt(previous) + 1;}", @@ -35,9 +36,12 @@ prevent_initial_call=True, ) def on_bg_progress(set_progress, _): - set_progress("start") - time.sleep(2) - set_progress("stop") + with lock: + set_progress("start") + time.sleep(0.5) + set_progress("stop") + time.sleep(0.5) + set_progress(no_update) return "done" diff --git a/tests/integration/long_callback/test_basic_long_callback014.py b/tests/integration/long_callback/test_basic_long_callback014.py index 47ff2f1155..826407f210 100644 --- a/tests/integration/long_callback/test_basic_long_callback014.py +++ b/tests/integration/long_callback/test_basic_long_callback014.py @@ -13,5 +13,6 @@ def test_lcbc014_progress_delete(dash_duo, manager): dash_duo.start_server(app) dash_duo.find_element("#start").click() dash_duo.wait_for_text_to_equal("#output", "done") - - assert dash_duo.find_element("#progress-counter").text == "2" + with app.test_lock: + assert dash_duo.find_element("#progress-output").text == "stop" + assert dash_duo.find_element("#progress-counter").text == "2"