Skip to content

Commit 3f817f2

Browse files
authored
fix(test): use unique bridge names and relaxed count assertions (#21966)
* fix(test): use unique bridge names and relaxed count assertions TestORM_UpdateBridgeType used a hardcoded "UniqueName" and asserted the global bridge count was exactly 1. With shared DB state from parallel tests or -count=N, the global count includes other bridges. Use UUID-based names and assert >= 1 instead of exact count. Verify deletion by checking the specific bridge is not found. Fixes: CORE-2391 * fix(test): drop global count assertion, verify specific bridge only The GreaterOrEqual count check was still fragile. The test only needs to verify its own bridge exists and can be deleted — not count how many bridges exist globally. Fixes: CORE-2391 * fix(test): restore exact count assertions with UUID bridge names The txdb wrapper should provide per-test transaction isolation, so exact count assertions are valid. Restore them — if CI fails, the real bug is broken DB isolation, not the test. The only change from the original test is UUID-based bridge names to avoid hardcoded "UniqueName" collisions. Fixes: CORE-2391
1 parent cdc60a7 commit 3f817f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

core/bridges/orm_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ func TestORM_UpdateBridgeType(t *testing.T) {
107107
ctx := testutils.Context(t)
108108
_, orm := setupORM(t)
109109

110+
bridgeName := bridges.BridgeName("bridge-" + uuid.New().String()[:8])
110111
firstBridge := &bridges.BridgeType{
111-
Name: "UniqueName",
112+
Name: bridgeName,
112113
URL: cltest.WebURL(t, "http:/oneurl.com"),
113114
}
114115

@@ -120,7 +121,7 @@ func TestORM_UpdateBridgeType(t *testing.T) {
120121

121122
require.NoError(t, orm.UpdateBridgeType(ctx, firstBridge, updateBridge))
122123

123-
foundbridge, err := orm.FindBridge(ctx, "UniqueName")
124+
foundbridge, err := orm.FindBridge(ctx, bridgeName)
124125
require.NoError(t, err)
125126
require.Equal(t, updateBridge.URL, foundbridge.URL)
126127

0 commit comments

Comments
 (0)