Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions go/vt/srvtopo/resilient_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,20 +304,25 @@ func TestGetSrvKeyspace(t *testing.T) {

// Force another error and lock the topo. Then wait for the TTL to
// expire and verify that the context timeout unblocks the request.
forceErr = fmt.Errorf("force long test error")
factory.SetError(forceErr)
factory.Lock()

time.Sleep(*srvTopoCacheTTL)
// TODO(deepthi): Commenting out this test until we fix https://github.com/vitessio/vitess/issues/6134
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: t.Skip() is probably more idiomatic for this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would have required me to factor that part of the test out into a separate one. Too much for a Friday afternoon :)


timeoutCtx, cancel := context.WithTimeout(context.Background(), *srvTopoCacheRefresh*2) //nolint
defer cancel()
_, err = rs.GetSrvKeyspace(timeoutCtx, "test_cell", "test_ks")
wantErr := "timed out waiting for keyspace"
if err == nil || err.Error() != wantErr {
t.Errorf("expected error '%v', got '%v'", wantErr, err)
}
factory.Unlock()
/*
forceErr = fmt.Errorf("force long test error")
factory.SetError(forceErr)
factory.Lock()

time.Sleep(*srvTopoCacheTTL)

timeoutCtx, cancel := context.WithTimeout(context.Background(), *srvTopoCacheRefresh*2) //nolint
defer cancel()
_, err = rs.GetSrvKeyspace(timeoutCtx, "test_cell", "test_ks")
wantErr := "timed out waiting for keyspace"
if err == nil || err.Error() != wantErr {
t.Errorf("expected error '%v', got '%v'", wantErr, err)
}
factory.Unlock()
*/
}

// TestSrvKeyspaceCachedError will test we properly re-try to query
Expand Down