Skip to content

Timeout isn't working as expected if both stdout and stderr are redirected #65

@dmeremyanin

Description

@dmeremyanin

Describe the problem

Timeout isn't working as expected if both stdout and stderr are redirected.

Steps to reproduce the problem

TTY::Command.new(printer: :quiet).run!('sleep 5', timeout: 1, [:out, :err] => '/dev/null')

Actual behaviour

The code above doesn't fail. It takes 5 seconds to run and ignores the timeout option set to 1 second.

Expected behaviour

The code above should raise an exception.

Describe your environment

  • OS version: macOS Ventura 13.5 / Debian 12
  • Ruby version: 3.2.2
  • TTY::Command version: 0.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions