Commit ba8d063
committed
fix: maak KubectlConnector veilig instantieerbaar zonder event loop
Het backup-overhaul (bbaff65) liet *BackupManager-instanties direct in
test-init draaien. Die kwam langs KubectlConnector.__init__ waar
asyncio.create_task(self._connection_retry()) onvoorwaardelijk werd
aangeroepen. In een synchrone test-context (geen running loop) gaf dat
RuntimeError: no running event loop — 7 backup-pod-template tests
crashten op init, voor ze ook maar één regel test-logica draaiden.
Fix: vang de RuntimeError af en laat het retry-task gewoon uit; de eerste
async aanroep werkt zonder retry-task en de connector instantieert
voortaan veilig in elke context.
Plus: test_full_flow_yaml_to_task_creation gemarkeerd als requires_infra.
Die test roept scheduler._check_and_schedule() aan zonder Kopia/kubectl
te mocken, dus hij heeft een echte kubectl-verbinding nodig (de scheduler
leest de AGE secret om de Kopia-password af te leiden). Tot iemand de
mocks afmaakt hoort hij niet in de pre-push unit-test gate.1 parent 916c4a5 commit ba8d063
2 files changed
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
78 | 81 | | |
79 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
80 | 87 | | |
81 | 88 | | |
82 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
| 734 | + | |
734 | 735 | | |
735 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
736 | 745 | | |
737 | 746 | | |
738 | 747 | | |
| |||
0 commit comments