Skip to content

Commit c164fc6

Browse files
committed
Try improve async tests timeout
1 parent fc634a9 commit c164fc6

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

dash/background_callback/managers/diskcache_manager.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,14 @@ async def async_run():
287287
}
288288
},
289289
)
290+
290291
if asyncio.iscoroutine(user_callback_output):
291292
user_callback_output = await user_callback_output
292293
if not errored:
293-
cache.set(result_key, user_callback_output)
294+
try:
295+
cache.set(result_key, user_callback_output)
296+
except Exception as err:
297+
print(f"Diskcache manager couldn't save output: {err}")
294298

295299
if asyncio.iscoroutinefunction(fn):
296300
func = partial(ctx.run, async_run)

tests/background_callback/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def setup_background_callback_app(manager_name, app_name):
150150
for job in manager.running_jobs:
151151
manager.terminate_job(job)
152152

153+
time.sleep(1)
154+
153155
shutil.rmtree(cache_directory, ignore_errors=True)
154156
os.environ.pop("LONG_CALLBACK_MANAGER")
155157
os.environ.pop("DISKCACHE_DIR")

0 commit comments

Comments
 (0)