Skip to content

Conversation

@jcouball
Copy link
Member

@jcouball jcouball commented Feb 3, 2024

In this PR, the ProcessExecuter.spawn was changed to return a ProcessExecuter::Status instead of a Process::Status. The former is a SimpleDelegator to the latter adding a timeout flag to the initializer and adding a timeout? attribute.

ProcessExecuter.spawn was changed to note if the subprocess it spawns timed out or not in the returned ProcessExecuter::Status object.

Example:

require 'process_executer'

status = ProcessExecuter.spawn('sleep 10', timeout: 0.01)
status.signaled? #=> true
status.termsig #=> 9
status.timeout? #=> true

@jcouball jcouball added the minor-change The PR adds new features, deprecates existing features, or makes substantial improvements label Feb 3, 2024
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit e414135 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 100.0% (0.0% change).

View more on Code Climate.

@jcouball jcouball changed the title ProcessExecuter.spawn should indicate if the subprocess timed out or not Add timeout? flag to the status returned by ProcessExecuter.spawn Feb 3, 2024
@jcouball jcouball changed the title Add timeout? flag to the status returned by ProcessExecuter.spawn Add :timeout? attribute to the status returned by ProcessExecuter.spawn Feb 3, 2024
@jcouball jcouball changed the title Add :timeout? attribute to the status returned by ProcessExecuter.spawn Add :timeout? attribute to the status returned by ProcessExecuter.spawn Feb 3, 2024
@jcouball jcouball merged commit a473281 into main Feb 3, 2024
@jcouball jcouball deleted the add_timeout_flag branch February 3, 2024 01:10
@jcouball jcouball mentioned this pull request Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor-change The PR adds new features, deprecates existing features, or makes substantial improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants