@@ -25,10 +25,15 @@ suite('gopls issue report tests', () => {
25
25
in : traceFromIssueVSCodeGo572LSP317 ,
26
26
want : sanitizedTraceFromIssueVSCodeGo572LSP317
27
27
} ,
28
+ {
29
+ name : 'panic trace 2024 March' ,
30
+ in : trace2024MarchPanic ,
31
+ want : sanitizedTrace2024MarchPanic
32
+ } ,
28
33
{
29
34
name : 'incomplete panic trace' ,
30
- in : 'panic: \nsecret \n' ,
31
- wantReason : 'incomplete panic trace '
35
+ in : 'panic: \ntruncated \n' ,
36
+ want : 'panic: \ntruncated\n '
32
37
} ,
33
38
{
34
39
name : 'incomplete initialization error message' ,
@@ -42,7 +47,7 @@ suite('gopls issue report tests', () => {
42
47
assert . strictEqual (
43
48
JSON . stringify ( sanitizedLog ) ,
44
49
JSON . stringify ( tc . want ) ,
45
- `sanitizeGoplsTrace(${ tc . name } ) returned unexpected sanitizedLog result`
50
+ `sanitizeGoplsTrace(${ tc . name } ) returned unexpected sanitizedLog result - ${ sanitizedLog } `
46
51
) ;
47
52
assert . strictEqual (
48
53
failureReason ,
@@ -315,7 +320,7 @@ golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1.2(0xc00021ac60, 0xc0007b
315
320
handler.go:103 +0x86
316
321
created by golang.org/x/tools/internal/jsonrpc2.AsyncHandler.func1
317
322
handler.go:100 +0x171
318
- [Info - 12:50:26 PM] `;
323
+ ` ;
319
324
320
325
const traceFromIssueVSCodeGo572LSP317 = `
321
326
[Error - 12:20:35 PM] Stopping server failed
@@ -335,3 +340,47 @@ Error starting language server: Error: Socket closed before the connection was e
335
340
const sanitizedTraceFromIssueVSCodeGo572LSP317 = `gopls client: couldn't create connection to server.
336
341
Message: Socket closed before the connection was established
337
342
Code: -32099 ` ;
343
+
344
+ const trace2024MarchPanic = `
345
+ [Info - 9:58:40 AM]
346
+ true
347
+ [Error - 9:58:40 AM] gopls client: couldn't create connection to server.
348
+ Message: Pending response rejected since connection got disposed
349
+ Code: -32097
350
+ panic: crash
351
+
352
+ goroutine 1 [running]:
353
+ golang.org/x/tools/gopls/internal/cmd.(*Serve).Run(0xc000486310?, {0xc0000b8090?, 0x0?}, {0x0?, 0x0?, 0x0?})
354
+ /Users/Gopher/projects/tools/gopls/internal/cmd/serve.go:81 +0x25
355
+ golang.org/x/tools/internal/tool.Run({0x1012d048, 0xc00019c3f0}, 0xc000486310, {0x1012f9e0, 0xc000159b40}, {0xc0000b8090, 0x0, 0x0})
356
+ /Users/Gopher/projects/tools/internal/tool/tool.go:192 +0x691
357
+ golang.org/x/tools/gopls/internal/cmd.(*Application).Run(0xc000159b00, {0x1012d010, 0x107d9840}, {0xc0000b8090, 0x0, 0x0})
358
+ /Users/Gopher/projects/tools/gopls/internal/cmd/cmd.go:240 +0x147
359
+ golang.org/x/tools/internal/tool.Run({0x1012d010, 0x107d9840}, 0xc0004862a0, {0x1012f3a0, 0xc000159b00}, {0xc0000b8060, 0x4, 0x4})
360
+ /Users/Gopher/projects/tools/internal/tool/tool.go:192 +0x691
361
+ golang.org/x/tools/internal/tool.Main({0x1012d010, 0x107d9840}, {0x1012f3a0, 0xc000159b00}, {0xc0000b8060, 0x4, 0x4})
362
+ /Users/Gopher/projects/tools/internal/tool/tool.go:93 +0x12a
363
+ main.main()
364
+ /Users/Gopher/projects/tools/gopls/main.go:34 +0x109
365
+ [Error - 9:58:49 AM]
366
+ [Error - 9:58:49 AM] gopls client: couldn't create connection to server.
367
+ Message: Pending response rejected since connection got disposed
368
+ Code: -32097
369
+ Error starting language server: Error: Pending response rejected since connection got disposed` ;
370
+
371
+ const sanitizedTrace2024MarchPanic = `panic: crash
372
+
373
+ goroutine 1 [running]:
374
+ golang.org/x/tools/gopls/internal/cmd.(*Serve).Run(0xc000486310?, {0xc0000b8090?, 0x0?}, {0x0?, 0x0?, 0x0?})
375
+ serve.go:81 +0x25
376
+ golang.org/x/tools/internal/tool.Run({0x1012d048, 0xc00019c3f0}, 0xc000486310, {0x1012f9e0, 0xc000159b40}, {0xc0000b8090, 0x0, 0x0})
377
+ tool.go:192 +0x691
378
+ golang.org/x/tools/gopls/internal/cmd.(*Application).Run(0xc000159b00, {0x1012d010, 0x107d9840}, {0xc0000b8090, 0x0, 0x0})
379
+ cmd.go:240 +0x147
380
+ golang.org/x/tools/internal/tool.Run({0x1012d010, 0x107d9840}, 0xc0004862a0, {0x1012f3a0, 0xc000159b00}, {0xc0000b8060, 0x4, 0x4})
381
+ tool.go:192 +0x691
382
+ golang.org/x/tools/internal/tool.Main({0x1012d010, 0x107d9840}, {0x1012f3a0, 0xc000159b00}, {0xc0000b8060, 0x4, 0x4})
383
+ tool.go:93 +0x12a
384
+ main.main()
385
+ main.go:34 +0x109
386
+ ` ;
0 commit comments