fix: remove shared pbac feature flag deletion from e2e test cleanup (#28573)

The afterAll hooks in PBAC-related e2e specs were deleting the global
'pbac' feature definition via featuresRepositoryFixture.deleteBySlug().
When multiple test suites run in parallel, one suite's cleanup would
delete the feature while other suites still depend on it, causing
intermittent failures.

Each test already creates its own team-level feature flag association
and cleans that up correctly. The global feature definition does not
need per-suite deletion and is better left intact to avoid cross-suite
interference.

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Alex van AndelandDevin AI authored and GitHub committed 2026-03-24 21:35:13 +00:00
1 parent b46c04da87
commit e9e96671bd
4 files changed
-26

No files matched your search

@@ -626,12 +626,6 @@ describe("Organizations Roles Endpoints", () => {
await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
await userRepositoryFixture.deleteByEmail(pbacOrgUserWithoutRolePermission.email);
await userRepositoryFixture.deleteByEmail(nonOrgUser.email);
try {
await featuresRepositoryFixture.deleteBySlug("pbac");
} catch (error) {
console.error("Cleanup error:", error);
}
} catch (error) {
console.error("Cleanup error:", error);
} finally {
@@ -382,13 +382,6 @@ describe("Organizations Roles Permissions Endpoints", () => {
// Clean up user
await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
// Clean up feature definition
try {
await featuresRepositoryFixture.deleteBySlug("pbac");
} catch (err) {
console.log(err);
}
} catch (err) {
console.log(err);
} finally {
@@ -457,12 +457,6 @@ describe("Organizations Roles Endpoints", () => {
await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
await userRepositoryFixture.deleteByEmail(pbacOrgUserWithoutRolePermission.email);
await userRepositoryFixture.deleteByEmail(nonOrgUser.email);
try {
await featuresRepositoryFixture.deleteBySlug("pbac");
} catch (error) {
console.error("Cleanup error:", error);
}
} catch (error) {
console.error("Cleanup error:", error);
} finally {
@@ -274,13 +274,6 @@ describe("Organizations Teams Roles Permissions Endpoints", () => {
// Clean up user
await userRepositoryFixture.deleteByEmail(pbacOrgUserWithRolePermission.email);
// Clean up feature definition
try {
await featuresRepositoryFixture.deleteBySlug("pbac");
} catch (err) {
console.log(err);
}
} catch (err) {
console.log(err);
} finally {