From 0f06078c6f97b8d5ff2058d52418620c3684a7d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 16 Nov 2025 13:45:27 -0800 Subject: [PATCH] home-assistant: skip another flaky test Multiple people have seen failures like this: _________________ test_platform_multiple_triggers[sync_action] _________________ [gw6] linux -- Python 3.13.9 /nix/store/7gl4khq26h625mpqzkiiqsify3hclar1-python3-3.13.9/bin/python3.13 hass = action_method = > @pytest.mark.parametrize("action_method", ["cb_action", "sync_action", "async_action"]) async def test_platform_multiple_triggers( hass: HomeAssistant, action_method: str ) -> None: """Test a trigger platform with multiple trigger.""" class MockTrigger(Trigger): """Mock trigger.""" @classmethod async def async_validate_config( cls, hass: HomeAssistant, config: ConfigType ) -> ConfigType: """Validate config.""" return config class MockTrigger1(MockTrigger): """Mock trigger 1.""" async def async_attach_runner( self, run_action: TriggerActionRunner ) -> CALLBACK_TYPE: """Attach a trigger.""" run_action({"extra": "test_trigger_1"}, "trigger 1 desc") class MockTrigger2(MockTrigger): """Mock trigger 2.""" async def async_attach_runner( self, run_action: TriggerActionRunner ) -> CALLBACK_TYPE: """Attach a trigger.""" run_action({"extra": "test_trigger_2"}, "trigger 2 desc") async def async_get_triggers(hass: HomeAssistant) -> dict[str, type[Trigger]]: return { "_": MockTrigger1, "trig_2": MockTrigger2, } mock_integration(hass, MockModule("test")) mock_platform(hass, "test.trigger", Mock(async_get_triggers=async_get_triggers)) config_1 = [{"platform": "test"}] config_2 = [{"platform": "test.trig_2", "options": {"x": 1}}] config_3 = [{"platform": "test.unknown_trig"}] assert await async_validate_trigger_config(hass, config_1) == config_1 assert await async_validate_trigger_config(hass, config_2) == config_2 with pytest.raises( vol.Invalid, match="Invalid trigger 'test.unknown_trig' specified" ): await async_validate_trigger_config(hass, config_3) log_cb = MagicMock() action_helper = TriggerActionFunctionTypeHelper() action_method = getattr(action_helper, action_method) await async_initialize_triggers(hass, config_1, action_method, "test", "", log_cb) > assert len(action_helper.action_calls) == 1 E assert 0 == 1 E + where 0 = len([]) E + where [] = .action_calls MockTrigger = .MockTrigger'> MockTrigger1 = .MockTrigger1'> MockTrigger2 = .MockTrigger2'> action_helper = action_method = > async_get_triggers = .async_get_triggers at 0x7fff807a32e0> config_1 = [{'platform': 'test'}] config_2 = [{'options': {'x': 1}, 'platform': 'test.trig_2'}] config_3 = [{'platform': 'test.unknown_trig'}] hass = log_cb = tests/helpers/test_trigger.py:530: AssertionError --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index adea8b1a0751..e13ae67adf8f 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -500,6 +500,7 @@ python.pkgs.buildPythonApplication rec { "tests/test_bootstrap.py::test_setup_hass_takes_longer_than_log_slow_startup" "tests/test_test_fixtures.py::test_evict_faked_translations" "tests/helpers/test_backup.py::test_async_get_manager" + "tests/helpers/test_trigger.py::test_platform_multiple_triggers[sync_action]" ]; preCheck = ''