TestClusterConfigAfterClose checks that ClusterConfig does not deadlock when ClusterConfig is called on a closed connection.
(t *testing.T)
| 500 | // TestClusterConfigAfterClose checks that ClusterConfig does not deadlock when |
| 501 | // ClusterConfig is called on a closed connection. |
| 502 | func TestClusterConfigAfterClose(t *testing.T) { |
| 503 | m := newTestModel() |
| 504 | |
| 505 | rw := testutil.NewBlockingRW() |
| 506 | c := getRawConnection(NewConnection(c0ID, rw, rw, testutil.NoopCloser{}, m, new(mockedConnectionInfo), CompressionAlways, testKeyGen)) |
| 507 | c.Start() |
| 508 | defer closeAndWait(c, rw) |
| 509 | |
| 510 | c.internalClose(errManual) |
| 511 | |
| 512 | done := make(chan struct{}) |
| 513 | go func() { |
| 514 | c.ClusterConfig(&ClusterConfig{}, nil) |
| 515 | close(done) |
| 516 | }() |
| 517 | |
| 518 | select { |
| 519 | case <-done: |
| 520 | case <-time.After(time.Second): |
| 521 | t.Fatal("timed out before Cluster Config returned") |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | func TestDispatcherToCloseDeadlock(t *testing.T) { |
| 526 | // Verify that we don't deadlock when calling Close() from within one of |
nothing calls this directly
no test coverage detected