@@ -172,6 +172,9 @@ func TestTakeWriteSessionFromIdleList(t *testing.T) {
172
172
173
173
// TestTakeFromIdleListChecked tests taking sessions from session pool's idle list, but with a extra ping check.
174
174
func TestTakeFromIdleListChecked (t * testing.T ) {
175
+ if testing .Short () {
176
+ t .SkipNow ()
177
+ }
175
178
sp , sc , cancel := setup (t , SessionPoolConfig {})
176
179
defer cancel ()
177
180
// Stop healthcheck workers to simulate slow pings.
@@ -222,6 +225,9 @@ func TestTakeFromIdleListChecked(t *testing.T) {
222
225
223
226
// TestTakeFromIdleWriteListChecked tests taking sessions from session pool's idle list, but with a extra ping check.
224
227
func TestTakeFromIdleWriteListChecked (t * testing.T ) {
228
+ if testing .Short () {
229
+ t .SkipNow ()
230
+ }
225
231
sp , sc , cancel := setup (t , SessionPoolConfig {})
226
232
defer cancel ()
227
233
sc .MakeNice ()
@@ -273,6 +279,9 @@ func TestTakeFromIdleWriteListChecked(t *testing.T) {
273
279
274
280
// TestMaxOpenedSessions tests max open sessions constraint.
275
281
func TestMaxOpenedSessions (t * testing.T ) {
282
+ if testing .Short () {
283
+ t .SkipNow ()
284
+ }
276
285
sp , _ , cancel := setup (t , SessionPoolConfig {MaxOpened : 1 })
277
286
defer cancel ()
278
287
sh1 , err := sp .take (context .Background ())
@@ -334,6 +343,9 @@ func TestMinOpenedSessions(t *testing.T) {
334
343
335
344
// TestMaxBurst tests max burst constraint.
336
345
func TestMaxBurst (t * testing.T ) {
346
+ if testing .Short () {
347
+ t .SkipNow ()
348
+ }
337
349
sp , sc , cancel := setup (t , SessionPoolConfig {MaxBurst : 1 })
338
350
defer cancel ()
339
351
// Will cause session creation RPC to be retried forever.
@@ -373,6 +385,9 @@ func TestMaxBurst(t *testing.T) {
373
385
374
386
// TestSessionrecycle tests recycling sessions.
375
387
func TestSessionRecycle (t * testing.T ) {
388
+ if testing .Short () {
389
+ t .SkipNow ()
390
+ }
376
391
sp , _ , cancel := setup (t , SessionPoolConfig {MaxSessionAge : 100 * time .Millisecond , MinOpened : 1 })
377
392
// Healthcheck is explicitly turned off in this test because it might aggressively expire sessions in idle list.
378
393
sp .hc .close ()
@@ -456,6 +471,9 @@ func TestHcHeap(t *testing.T) {
456
471
457
472
// TestHealthCheckScheduler tests if healthcheck workers can schedule and perform healthchecks properly.
458
473
func TestHealthCheckScheduler (t * testing.T ) {
474
+ if testing .Short () {
475
+ t .SkipNow ()
476
+ }
459
477
sp , sc , cancel := setup (t , SessionPoolConfig {})
460
478
defer cancel ()
461
479
// Create 50 sessions.
@@ -485,6 +503,9 @@ func TestHealthCheckScheduler(t *testing.T) {
485
503
486
504
// Tests that a fractions of sessions are prepared for write by health checker.
487
505
func TestWriteSessionsPrepared (t * testing.T ) {
506
+ if testing .Short () {
507
+ t .SkipNow ()
508
+ }
488
509
sp , sc , cancel := setup (t , SessionPoolConfig {WriteSessions : 0.5 })
489
510
sc .MakeNice ()
490
511
defer cancel ()
@@ -536,6 +557,9 @@ func TestWriteSessionsPrepared(t *testing.T) {
536
557
537
558
// TestTakeFromWriteQueue tests that sessionPool.take() returns write prepared sessions as well.
538
559
func TestTakeFromWriteQueue (t * testing.T ) {
560
+ if testing .Short () {
561
+ t .SkipNow ()
562
+ }
539
563
sp , sc , cancel := setup (t , SessionPoolConfig {MaxOpened : 1 , WriteSessions : 1.0 })
540
564
sc .MakeNice ()
541
565
defer cancel ()
@@ -561,6 +585,9 @@ func TestTakeFromWriteQueue(t *testing.T) {
561
585
562
586
// TestSessionHealthCheck tests healthchecking cases.
563
587
func TestSessionHealthCheck (t * testing.T ) {
588
+ if testing .Short () {
589
+ t .SkipNow ()
590
+ }
564
591
sp , sc , cancel := setup (t , SessionPoolConfig {MaxSessionAge : 2 * time .Second })
565
592
defer cancel ()
566
593
// Test pinging sessions.
@@ -641,6 +668,9 @@ func TestSessionHealthCheck(t *testing.T) {
641
668
// when all test workers and healthcheck workers exit, mockclient, session pool and healthchecker should be in consistent state.
642
669
func TestStressSessionPool (t * testing.T ) {
643
670
// Use concurrent workers to test different session pool built from different configurations.
671
+ if testing .Short () {
672
+ t .SkipNow ()
673
+ }
644
674
for ti , cfg := range []SessionPoolConfig {
645
675
SessionPoolConfig {},
646
676
SessionPoolConfig {MaxSessionAge : 20 * time .Millisecond },
0 commit comments