git.iko.soy/typeable/nixpkgs
on master help sign in
home-assistant: add patch to fix flapping logging test
commit87d4e1230b458b3a43a18003fa22ad7f98a831df authorMartin Weinelt <hexa@darmstadt.ccc.de> dateMon 3 Aug 2020, 16:16 (6 years ago) parentec4df17
2 files changed+34
pkgs/servers/home-assistant/default.nix+1 pkgs/servers/home-assistant/fix-flapping-chained-task-logging-test.patch+33
pkgs/servers/home-assistant/default.nix+1
@@ -82,6 +82,7 @@ in with py.pkgs; buildPythonApplication rec {
8282
8383 patches = [
8484 ./relax-dependencies.patch
85+ ./fix-flapping-chained-task-logging-test.patch
8586 ];
8687
8788 inherit availableComponents;
pkgs/servers/home-assistant/fix-flapping-chained-task-logging-test.patchnew file+33
@@ -0,0 +1,33 @@
1+From 1d54dafad9968465d995d195f683d8032a5194d1 Mon Sep 17 00:00:00 2001
2+From: "J. Nick Koston" <nick@koston.org>
3+Date: Sun, 2 Aug 2020 23:05:53 +0000
4+Subject: [PATCH] Fix flapping chained task logging test
5+
6+Creating 20 tasks was taking less than 0.0001 seconds which caused
7+the tests to fail. Increase the number of test tasks by two orders
8+of magnitude.
9+---
10+ tests/test_core.py | 4 ++--
11+ 1 file changed, 2 insertions(+), 2 deletions(-)
12+
13+diff --git a/tests/test_core.py b/tests/test_core.py
14+index 12ed00fde2c9..167eda3f6cb4 100644
15+--- a/tests/test_core.py
16++++ b/tests/test_core.py
17+@@ -1436,14 +1436,14 @@ async def test_chained_logging_hits_log_timeout(hass, caplog):
18+ async def _task_chain_1():
19+ nonlocal created
20+ created += 1
21+- if created > 10:
22++ if created > 1000:
23+ return
24+ hass.async_create_task(_task_chain_2())
25+
26+ async def _task_chain_2():
27+ nonlocal created
28+ created += 1
29+- if created > 10:
30++ if created > 1000:
31+ return
32+ hass.async_create_task(_task_chain_1())
33+