mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Detect lingering threads after tests (#37270)
* Detect lingering threads after tests * Make sure cast is setup before checking state * Make sure we ask executors of old hass to shutdown We are not waiting here, just hoping for the best * Make sure all instances of hass and executors is stopped. Co-authored-by: Paulus Schoutsen <balloob@gmail.com> * Also apply hass stopping to scripts * Adjust to changes how we set up executor * Add new CoreState.stopped Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
@@ -152,6 +152,7 @@ class CoreState(enum.Enum):
|
||||
running = "RUNNING"
|
||||
stopping = "STOPPING"
|
||||
final_write = "FINAL_WRITE"
|
||||
stopped = "STOPPED"
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""Return the event."""
|
||||
@@ -443,6 +444,7 @@ class HomeAssistant:
|
||||
await self.loop.shutdown_default_executor() # type: ignore
|
||||
|
||||
self.exit_code = exit_code
|
||||
self.state = CoreState.stopped
|
||||
|
||||
if self._stopped is not None:
|
||||
self._stopped.set()
|
||||
|
||||
Reference in New Issue
Block a user