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

test: pipe requires tmpdir #3231

Closed
wants to merge 1 commit into from
Closed

Conversation

Trott
Copy link
Member

@Trott Trott commented Oct 7, 2015

Fixes #3227

Except on Windows, common.PIPE is in the temp directory. So tests that use common.PIPE need to call common.refreshTmpDir(). I dislike the non-obvious coupling of those two things, and maybe there's a better solution, but for the moment at least, this fixes it.

@Trott Trott changed the title Pipe requires tmpdir test: pipe requires tmpdir Oct 7, 2015
@Trott Trott added the test Issues and PRs related to the tests. label Oct 7, 2015
@Trott
Copy link
Member Author

Trott commented Oct 7, 2015

@Fishrock123
Copy link
Contributor

I dislike the non-obvious coupling of those two things, and maybe there's a better solution, but for the moment at least, this fixes it.

I think this is the more important point. I think this is a better approach: Fishrock123@34daef2

(Writable should allow things to overwrite it as if it were a regular value, I think?)

@Fishrock123
Copy link
Contributor

Basically, minimizing the institutional knowledge, whether linted or not, is more important in the long run.

@Fishrock123
Copy link
Contributor

(You'd still need these patches though I think.)

Also this still only works if you refresh the tmpdir first, for I think obvious reasons. I'm not sure if that is practical to track.

common.PIPE resides in the temp directory (except on Windows). Insure
that the temp directory is refreshed in tests that use common.PIPE.

Fixes: nodejs#3227
@Trott
Copy link
Member Author

Trott commented Oct 7, 2015

@Fishrock123 I'm trying to think of ways to decouple the use of common.PIPE from a need to refresh the temp directory. We could:

  • Move the temp directory refresh back into the Python wrapper. I don't like that idea because I'd like to see less Python and more JS, but the fact is that it will work. Minor down side there is that it won't work if you are running the test from the command line (rather than via the Makefile) and the temp dir does not exist (and maybe other situations like the pipe already exists and is in use or something).
  • Move the pipe out of the test-level temp dir and move it to the system temp dir. We'd need a safe way to generate a different name for it each run, similar to POSIX tmpnam() or else all tests that use common.PIPE need to be moved out of test/parallel.

@rvagg
Copy link
Member

rvagg commented Oct 7, 2015

@jbergstroem has been talking about turning PIPE into a directory so we can parallelise more tests, there's likely some overlap with that discussion and this PR

@jbergstroem
Copy link
Member

Re above: @Trott On top of your stuff, I'd like to expose an option to pass a directory in where the temporary directories/files are stored and create/clean that when starting the test runner. Once this is made we should just remove all logic related to NODE_COMMON_PIPE since that breaks parallel runs. We lean on this option in CI.

@rvagg
Copy link
Member

rvagg commented Oct 7, 2015

Just for background on NODE_COMMON_PIPE for those editing it—it's there because the full path name can be too long for creating unix pipes which have a character limit, this is acute when run in Jenkins because the directories get deep and it's compounded by verbose naming of jobs and slaves. So on Jenkins we set it to ~/test.pipe (not actually ~) cause we know that's short enough.

Not that I see any of this impacting on these changes, just wanted to make sure y'all have that in mind when messing around there.

@Trott
Copy link
Member Author

Trott commented Oct 7, 2015

All of that sounds great to me.

None of the above alters the need for changes in this PR, does it?

@jbergstroem
Copy link
Member

@Trott Shouldn't. If so, I'll just modify post landing this. LGTM btw.

Trott added a commit to Trott/io.js that referenced this pull request Oct 9, 2015
common.PIPE resides in the temp directory (except on Windows). Insure
that the temp directory is refreshed in tests that use common.PIPE.

PR-URL: nodejs#3231
Fixes: nodejs#3227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
@Trott
Copy link
Member Author

Trott commented Oct 9, 2015

Landed in a1040f2

@Trott Trott closed this Oct 9, 2015
@jasnell
Copy link
Member

jasnell commented Oct 9, 2015

@Trott @jbergstroem @rvagg ... should this land in v4.x also?

@Trott
Copy link
Member Author

Trott commented Oct 9, 2015

@jasnell It's a bugfix for tests only so... ¯_(ツ)_/¯ Probably fine either way.

Trott added a commit that referenced this pull request Oct 10, 2015
common.PIPE resides in the temp directory (except on Windows). Insure
that the temp directory is refreshed in tests that use common.PIPE.

PR-URL: #3231
Fixes: #3227
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
@jasnell
Copy link
Member

jasnell commented Oct 10, 2015

Landed in v4.x in 7a5ae34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: refresh tmpDir before using common PIPE
6 participants