mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(rds): report backing container failures (#3455)
* fix(rds): reconcile dead backing containers * fix(rds): report backing container failures
This commit is contained in:
1 parent
fe076212c2
commit
68c783b576
6 files changed
+212
-2
No files matched your search
@@ -5484,6 +5484,29 @@ class RdsServiceTest {
|
||||
assertEquals("og1", modified.getOptionGroupName());
|
||||
}
|
||||
|
||||
@Test
|
||||
void refreshRuntimeHealthMarksDeadContainerFailedAndStopsProxy() {
|
||||
when(rdsConfig.mock()).thenReturn(false);
|
||||
when(containerManager.isContainerRunning("cont-id")).thenReturn(false);
|
||||
DbInstance instance = rdsService.createDbInstance(
|
||||
"dead-db", "postgres", "16", "admin", "password", "dbname",
|
||||
"db.t3.micro", 20, false, null, null, null, null, false, false,
|
||||
null, Map.of(), List.of(), null, null, true);
|
||||
|
||||
DbInstance refreshed = rdsService.refreshDbInstanceRuntimeHealth(instance);
|
||||
|
||||
assertEquals(DbInstanceStatus.FAILED, refreshed.getStatus());
|
||||
verify(proxyManager).stopProxy("rds-resource:" + refreshed.getDbInstanceArn());
|
||||
var events = rdsService.describeEvents("dead-db", "db-instance", null, null, 60);
|
||||
assertEquals(1, events.size());
|
||||
assertEquals(List.of("availability"), events.getFirst().eventCategories());
|
||||
assertEquals(refreshed.getDbInstanceArn(), events.getFirst().sourceArn());
|
||||
|
||||
// Repeated health reads do not duplicate the transition event.
|
||||
rdsService.refreshDbInstanceRuntimeHealth(refreshed);
|
||||
assertEquals(1, rdsService.describeEvents("dead-db", "db-instance", null, null, 60).size());
|
||||
}
|
||||
|
||||
@Test
|
||||
void optionGroupsUseTheInjectedAccountAwareStorage() {
|
||||
String accountId = "123456789012";
|
||||
|
||||
Reference in new issue
Block a user