Commit 87306cc
committed
fix(serve/tests): shut down AsyncioRouter after each test to prevent resource leaks
Per code review feedback: each AsyncioRouter instance spawns background
tasks (MetricsPusher, LongPollClient). Without explicit teardown these
tasks leak into subsequent tests. Add the same cleanup pattern used by
the existing setup_router fixture:
await router.shutdown()
router.long_poll_client.stop()
at the end of all three test cases in TestUpdateDeploymentConfigNullRouter.
Signed-off-by: chenshi5012 <chenshi5012@163.com>1 parent a666f4b commit 87306cc
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
| 1907 | + | |
| 1908 | + | |
1907 | 1909 | | |
1908 | 1910 | | |
1909 | 1911 | | |
| |||
1937 | 1939 | | |
1938 | 1940 | | |
1939 | 1941 | | |
| 1942 | + | |
| 1943 | + | |
1940 | 1944 | | |
1941 | 1945 | | |
1942 | 1946 | | |
| |||
1976 | 1980 | | |
1977 | 1981 | | |
1978 | 1982 | | |
| 1983 | + | |
| 1984 | + | |
1979 | 1985 | | |
1980 | 1986 | | |
1981 | 1987 | | |
| |||
0 commit comments