@@ -2,6 +2,7 @@ package ptytest_test
22
33import (
44 "fmt"
5+ "runtime"
56 "strings"
67 "testing"
78
@@ -25,19 +26,22 @@ func TestPtytest(t *testing.T) {
2526 t .Parallel ()
2627
2728 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.
3032 }{
3133 {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
3436 }
3537 for _ , tt := range tests {
3638 tt := tt
3739 // nolint:paralleltest // Avoid parallel test to more easily identify the issue.
3840 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+
4145 cmd := cobra.Command {
4246 Use : "test" ,
4347 RunE : func (cmd * cobra.Command , args []string ) error {
0 commit comments