mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
service/dap: fix TestConfigurationDoneWithoutDebugSession (#4071)
The test was flaky and occasionally caused a panic. This patch fixes it by properly disconnecting from the server and waiting for shutdown.
This commit is contained in:
@ -7229,7 +7229,6 @@ func TestBadlyFormattedMessageToServer(t *testing.T) {
|
|||||||
func TestConfigurationDoneWithoutDebugSession(t *testing.T) {
|
func TestConfigurationDoneWithoutDebugSession(t *testing.T) {
|
||||||
serverStopped := make(chan struct{})
|
serverStopped := make(chan struct{})
|
||||||
server, _ := startDAPServer(t, false, serverStopped)
|
server, _ := startDAPServer(t, false, serverStopped)
|
||||||
defer server.Stop()
|
|
||||||
|
|
||||||
client := daptest.NewClient(server.listener.Addr().String())
|
client := daptest.NewClient(server.listener.Addr().String())
|
||||||
defer client.Close()
|
defer client.Close()
|
||||||
@ -7248,6 +7247,11 @@ func TestConfigurationDoneWithoutDebugSession(t *testing.T) {
|
|||||||
t.Errorf("Expected error message %q, got %q", expectedMsg, resp.Body.Error.Format)
|
t.Errorf("Expected error message %q, got %q", expectedMsg, resp.Body.Error.Format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
client.DisconnectRequest()
|
||||||
|
client.ExpectDisconnectResponse(t)
|
||||||
|
client.ExpectTerminatedEvent(t)
|
||||||
|
|
||||||
|
<-serverStopped
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParseLogPoint(t *testing.T) {
|
func TestParseLogPoint(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user