Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert #167 to avoid race on Linux. #177

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,10 @@ jobs:
# Skip tests for 1.6 as we use modern Go.
# If the main lib builds and tests pass on other versions, we are good.
- if: ${{ matrix.go_version != '1.6.x' }}
name: Test
name: Single Test
run: go test -v

# Run the tests again 100 times without verbose.
- if: ${{ matrix.go_version != '1.6.x' }}
name: Many Tests
run: go test -count=100 -timeout=10s
4 changes: 4 additions & 0 deletions io_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ var glTestFdLock sync.Mutex
//
//nolint:paralleltest // Potential in (*os.File).Fd().
func TestReadDeadline(t *testing.T) {
t.Skip("Disabling while investigating race.")

ptmx, success := prepare(t)

if err := ptmx.SetDeadline(time.Now().Add(timeout / 10)); err != nil {
Expand Down Expand Up @@ -57,6 +59,8 @@ func TestReadDeadline(t *testing.T) {
//
//nolint:paralleltest // Potential in (*os.File).Fd().
func TestReadClose(t *testing.T) {
t.Skip("Disabling while investigating race.")

ptmx, success := prepare(t)

go func() {
Expand Down
5 changes: 5 additions & 0 deletions ioctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ package pty
import "os"

func ioctl(f *os.File, cmd, ptr uintptr) error {
return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io.
}

// NOTE: Unused. Keeping for reference.
func ioctlNonblock(f *os.File, cmd, ptr uintptr) error {
sc, e := f.SyscallConn()
if e != nil {
return ioctlInner(f.Fd(), cmd, ptr) // Fall back to blocking io (old behavior).
Expand Down