fix(identitystore): self-heal the bootstrap identity store on hasIdentityStore (#3387)

EmulatorInfoController.performReset() runs every Resettable.clear() (which
re-seeds SsoAdminService's default d-9067f2a3c1 instance) before calling
StorageFactory.clearAll(), which wipes the `instances` backend again right
after. Once any test in the same JVM fork hits /state/reset or /state/nuke,
the default identity store never comes back, so every later SCIM request's
hasIdentityStore check 401s for the rest of that fork — this is why
ScimIntegrationTest passes in isolation but fails in the full suite (#3386).

hasIdentityStore now self-heals the same way listInstances() already does,
by ensuring the bootstrap instance exists before checking.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-10 21:07:00 -04:00
1 parent 051a2f09db
commit b87ee5bd4a
2 files changed
+19 -1

No files matched your search

@@ -224,6 +224,9 @@ public class SsoAdminService implements Resettable {
if (identityStoreId == null) {
return false;
}
// Self-heals like listInstances(): storageFactory.clearAll() wipes `instances` right after
// clear() re-seeds it, so /state/reset otherwise leaves the bootstrap instance missing.
ensureBootstrapInstance(defaultAccountId, defaultRegion);
if (instances.scan(key -> true).stream()
.anyMatch(instance -> identityStoreId.equals(instance.identityStoreId()))) {
return true;