Skip to content

Commit fab657b

Browse files
committed
fix: better intest code
1 parent d37acfa commit fab657b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pkg/session/syssession/pool.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,14 @@ func (p *AdvancedSessionPool) WithForceBlockGCSession(ctx context.Context, fn fu
301301
for !infosync.StoreInternalSession(se.internal.sctx) {
302302
// In most cases, the session manager is not set, so this step will be skipped.
303303
// It is only enabled explicitly in tests through a failpoint.
304-
forceBlockGCInTest := !intest.InTest
305-
failpoint.Inject("ForceBlockGCInTest", func(val failpoint.Value) {
306-
forceBlockGCInTest = val.(bool)
307-
})
308-
if !forceBlockGCInTest {
309-
break
304+
if intest.InTest {
305+
forceBlockGCInTest := false
306+
failpoint.Inject("ForceBlockGCInTest", func(val failpoint.Value) {
307+
forceBlockGCInTest = val.(bool)
308+
})
309+
if !forceBlockGCInTest {
310+
break
311+
}
310312
}
311313

312314
// Check context cancellation

0 commit comments

Comments
 (0)