-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
chore(deps): bump foreground-child from ^2.0.0 to ^3.0.0 #1546
Conversation
@nwalters512 do you need to run
|
@bcoe can you say more about why this was closed? Is there anything I can do to help land this change? |
@kraenhansen thanks for the contribution. It looks like a few tests are failing, do you see this locally? |
@bcoe this is my contribution; I'm looking into the failure right now! |
My bad sorry, I was half paying attention, and it was @kraenhansen who reached out to me. |
I was able to fix one test failure cause, which was that The second failure relates to |
@nwalters512 two options:
|
(1) would seem to be the easiest, as https://github.com/istanbuljs/istanbul-lib-processinfo doesn't consistently order items in the tree, and the order actually changes the output of the lines we do want because of how the tree is rendered. It's worth noting that this change will be visible to users, in the form of an extra line in the process tree like this:
We could conceivably catch that and filter it out by looking for something like this: execArgv[0] === '-e' && execArgv[1].indexOf('foreground-child watchdog pid') !== -1 I'm not sure if that's worth the effort, or how brittle that would end up being in the long run if/when |
@nwalters512 the process tree is pretty niche, I'm comfortable with commenting out these tests as long as the majority of tests work that exercise core behaviour. |
@nwalters512 friendly nudge on this one 😄 |
@bcoe I haven't forgotten about this! I'm AFK on my honeymoon, I'll be able to get back to this on the week of May 6. If there's an urgent need to land this in the meantime, don't hesitate to make changes on my behalf. |
Congrats! |
@bcoe I was able to fix many of the broken tests today. There are now only four remaining: every test in |
test/nyc-integration.js
Outdated
// Disabled; see https://github.com/istanbuljs/nyc/pull/1546 | ||
// t.test('--show-process-tree displays a tree of spawned processes', t => testSuccess(t, { | ||
// args: ['--show-process-tree', process.execPath, 'selfspawn-fibonacci.js', '5'] | ||
// })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As desired, this test is now commented out. I left a link back to this PR for any future spelunkers.
test/processinfo.js
Outdated
// The subprocess is failing with the following error: | ||
// " External ID blorp used by multiple processes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to determine this by changing the preceding lines to the following:
- proc.stderr.resume()
- proc.stdout.resume()
+ proc.stderr.pipe(process.stderr)
+ proc.stdout.pipe(process.stdout)
This let me see the actual error message from the subprocess. This error actually comes from istanbul-lib-processinfo
: https://github.com/istanbuljs/istanbul-lib-processinfo/blob/b9cd52cf6eb140cf3bff24ba5df34d5812845d66/index.js#L250
I have no idea what blorp
is, what NYC_PROCESSINFO_EXTERNAL_ID
is supposed to do, or why it would end up being used by multiple processes (though this probably has something to do with the watchdog process that foreground-child
creates).
test/temp-dir.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes here were necessary to account for the new watchdog process from foreground-child
.
@nwalters512 if you're pretty confident that it's the tests that are fragile and not the update to foreground-child, I'm comfortable with us skipping appropriate tests. A couple nits:
There are still a healthy number of tests failing, is this expected based on "I have no idea what blorp is, what NYC_PROCESSINFO_EXTERNAL_ID is supposed to do", and we just need to comment out a couple more tests. nyc hasn't bee released in 4 years, and the next release is going to be a major. I'm excited for us to be on newer versions of deps, even if there's potentially some bugs that need to be ironed out after. |
@bcoe I updated the tests per your recommendation to use Lines 18 to 21 in 10daacc
I could try to add some tests to exercise and assert something about the code, or I could slap some |
I have a fix for getting coverage back to 100% (and not skipping any tests), but I'd need this first: tapjs/foreground-child#59 fix is pretty much this: // nyc.js:91
foregroundChild(childArgs, async (code, signal, processInfo) => {
let exitCode = process.exitCode || code
try {
// clean up foreground-child watchdog process info
const parentDir = path.resolve(nyc.tempDirectory())
const dir = path.resolve(nyc.tempDirectory(), 'processinfo')
const files = await nyc.coverageFiles(dir)
for (let i = 0; i < files.length; i++) {
const data = await nyc.coverageFileLoad(files[i], dir)
if (data.pid === processInfo.watchdog.pid) {
fs.unlinkSync(path.resolve(parentDir, files[i]))
fs.unlinkSync(path.resolve(dir, files[i]))
}
}
await nyc.writeProcessIndex() |
@isaacs is a saint and reviewd/merged the PR, so I PR'd this PR with the changes: nwalters512#1 |
Looking forward for this MR being merged ! |
@bcoe any chance you could follow up on this? 😸 |
This should resolve #1535.