Jelajahi Sumber

Sleep an extra second to avoid a race condition.

Jason Rumney 4 tahun lalu
induk
melakukan
6a5ec03099
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      tests/test_device.py

+ 1 - 1
tests/test_device.py

@@ -323,7 +323,7 @@ class TestDevice(IsolatedAsyncioTestCase):
         self.subject._cached_state = {"1": True}
         self.subject._cached_state = {"1": True}
         self.assertEqual(self.subject.get_property("1"), False)
         self.assertEqual(self.subject.get_property("1"), False)
         # wait for the debounce timer to avoid a teardown error
         # wait for the debounce timer to avoid a teardown error
-        sleep(1)
+        sleep(2)
 
 
     def test_debounces_multiple_set_calls_into_one_api_call(self):
     def test_debounces_multiple_set_calls_into_one_api_call(self):
         with patch("custom_components.tuya_local.device.Timer") as mock:
         with patch("custom_components.tuya_local.device.Timer") as mock: