Skip to content

Commit

Permalink
Cherry-pick 41a8d1d with conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
vitess-bot[bot] authored and vitess-bot committed Mar 3, 2025
1 parent 913c838 commit a51b76f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions go/vt/vtgate/schema/tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,41 @@ func TestTrackerGetKeyspaceUpdateController(t *testing.T) {
assert.Nil(t, ks3.reloadKeyspace, "ks3 already initialized")
}

<<<<<<< HEAD

Check failure on line 173 in go/vt/vtgate/schema/tracker_test.go

View workflow job for this annotation

GitHub Actions / Code Coverage

expected declaration, found '<<'

Check failure on line 173 in go/vt/vtgate/schema/tracker_test.go

View workflow job for this annotation

GitHub Actions / Code Coverage

expected declaration, found '<<'
=======
// TestTrackerNoLock tests that processing of health check is not blocked while tracking is making GetSchema rpc calls.
func TestTrackerNoLock(t *testing.T) {
ch := make(chan *discovery.TabletHealth)
tracker := NewTracker(ch, true, false, sqlparser.NewTestParser())
tracker.consumeDelay = 1 * time.Millisecond
tracker.Start()
defer tracker.Stop()

target := &querypb.Target{Cell: cell, Keyspace: keyspace, Shard: "-80", TabletType: topodatapb.TabletType_PRIMARY}
tablet := &topodatapb.Tablet{Keyspace: target.Keyspace, Shard: target.Shard, Type: target.TabletType}

sbc := sandboxconn.NewSandboxConn(tablet)
sbc.GetSchemaDelayResponse = 100 * time.Millisecond

th := &discovery.TabletHealth{
Conn: sbc,
Tablet: tablet,
Target: target,
Serving: true,
Stats: &querypb.RealtimeStats{TableSchemaChanged: []string{"t1"}},
}

for i := 0; i < 500000; i++ {
select {
case ch <- th:
case <-time.After(10 * time.Millisecond):
t.Fatalf("failed to send health check to tracker")
}
}
require.GreaterOrEqual(t, sbc.GetSchemaCount.Load(), int64(1), "GetSchema rpc should be called")
}

>>>>>>> 41a8d1dd32 (Fix TestTrackerNoLock flaky test by increasing time to mark failure (#17886))
type myTable struct {
name, create string
}
Expand Down

0 comments on commit a51b76f

Please sign in to comment.