@@ -2,6 +2,7 @@ package ptytest_test
2
2
3
3
import (
4
4
"fmt"
5
+ "runtime"
5
6
"strings"
6
7
"testing"
7
8
@@ -25,19 +26,22 @@ func TestPtytest(t *testing.T) {
25
26
t .Parallel ()
26
27
27
28
tests := []struct {
28
- name string
29
- output string
29
+ name string
30
+ output string
31
+ isPlatformBug bool // See https://github.com/coder/coder/issues/2122.
30
32
}{
31
33
{name : "1024 is safe (does not exceed macOS buffer)" , output : strings .Repeat ("." , 1024 )},
32
- {name : "1025 exceeds macOS buffer (must not hang)" , output : strings .Repeat ("." , 1025 )},
33
- {name : "10241 large output" , output : strings .Repeat ("." , 10241 )}, // 1024 * 10 + 1
34
+ {name : "1025 exceeds macOS buffer (must not hang)" , output : strings .Repeat ("." , 1025 ), isPlatformBug : true },
35
+ {name : "10241 large output" , output : strings .Repeat ("." , 10241 ), isPlatformBug : true }, // 1024 * 10 + 1
34
36
}
35
37
for _ , tt := range tests {
36
38
tt := tt
37
39
// nolint:paralleltest // Avoid parallel test to more easily identify the issue.
38
40
t .Run (tt .name , func (t * testing.T ) {
39
- // Example with cobra command instead of exec. More abstractions, but
40
- // for some reason works on linux.
41
+ if tt .isPlatformBug && (runtime .GOOS == "darwin" || runtime .GOOS == "windows" ) {
42
+ t .Skip ("This test does not (currently) work on macOS or Windows" )
43
+ }
44
+
41
45
cmd := cobra.Command {
42
46
Use : "test" ,
43
47
RunE : func (cmd * cobra.Command , args []string ) error {
0 commit comments