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

t/t0005-exec.t: Fix corner case in test for file not found #848

Merged
merged 1 commit into from
Oct 13, 2016

Conversation

chu11
Copy link
Member

@chu11 chu11 commented Oct 12, 2016

The fake file 'nosuchprocess' does not have a relative or absolute path specified. So the file will be searched for in all directories in the users PATH. If the user does not have access to one of the directories in their PATH, an EACCES error can occur instead of ENOENT, leading to a failed test. So put "./" in front of 'nosuchprocess' to ensure it is not searched for in PATH.

@garlick garlick added the review label Oct 12, 2016
@chu11
Copy link
Member Author

chu11 commented Oct 12, 2016

I should probably mention, of course one could just change my PATH that made me hit this issue. But in this particular case, the bad directory was part of the defaults on login, took me awhile to figure out the problem. So figured we could avoid the problem in the future.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.008%) to 75.135% when pulling 3bbdc96 on chu11:t0005-exec.t-corner-case into 286b6e7 on flux-framework:master.

@codecov-io
Copy link

codecov-io commented Oct 12, 2016

Current coverage is 71.52% (diff: 100%)

Merging #848 into master will not change coverage

@@             master       #848   diff @@
==========================================
  Files           157        157          
  Lines         26683      26683          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits          19085      19085          
  Misses         7598       7598          
  Partials          0          0          

Powered by Codecov. Last update fdea053...1d9d613

Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me. Nice catch!

@chu11
Copy link
Member Author

chu11 commented Oct 13, 2016

fyi, rebased on current master and now running through travis

The fake file 'nosuchprocess' does not have a relative or absolute
path specified.  So the file will be searched for in all
directories in the user's PATH.  If the user does not have access
to one of the directories in their PATH, an EACCES error can occur
instead of ENOENT, leading to a failed test.  So put "./" in front
of 'nosuchprocess' to ensure it is not searched for in PATH.
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 1d9d613 on chu11:t0005-exec.t-corner-case into * on flux-framework:master*.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 75.147% when pulling 1d9d613 on chu11:t0005-exec.t-corner-case into fdea053 on flux-framework:master.

@garlick
Copy link
Member

garlick commented Oct 13, 2016

Thanks!

@garlick garlick merged commit 1d3081d into flux-framework:master Oct 13, 2016
@garlick garlick removed the review label Oct 13, 2016
@garlick garlick mentioned this pull request Oct 26, 2016
@chu11 chu11 deleted the t0005-exec.t-corner-case branch June 5, 2021 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants