-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
Policy integrity test refactor via permutations #34404
Conversation
if (!tmpdirURL.pathname.endsWith('/')) { | ||
tmpdirURL.pathname += '/'; | ||
function drainQueue() { | ||
if (spawned < 100 !== true) { |
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.
Is this really clearer than if (spawned >= 100)
?
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.
don't really agree, but i'm fine changing it
debug(`stderr: ${Buffer.concat(stderr)}`); | ||
throw e; | ||
} | ||
drainQueue(); |
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.
This should be inside a finally
, right?
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.
no, we want to stop spawning things if we have an error
} | ||
throw new Error('unknown format ' + extension); | ||
} | ||
for (const permutation of permutations({ |
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.
❤️
CI seems to be unhappy with this change, local testing cannot repro. Wondering if this is related to the large number of child processes spawned, I do see some timeouts but other ones simply exit early with a non-zero code, a few are showing problems with the integrity and i also wonder if the number of files written is a problem. |
windows failing CI fix is in place, tests are still taking too long and timing out sometimes for CI, unclear on how to fix that. |
Landed in b04f2b6 |
PR-URL: #34404 Reviewed-By: James M Snell <[email protected]>
PR-URL: #34404 Reviewed-By: James M Snell <[email protected]>
PR-URL: #34404 Reviewed-By: James M Snell <[email protected]>
PR-URL: #34404 Reviewed-By: James M Snell <[email protected]>
PR-URL: #34404 Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesThis refactors the policy test to do a full set of permutations of various possible configurations. It is rather extensive and thus likely not best to put into fixtures. Along the way a few bugs were found, due to refactors that did not have test coverage such as the new
package_json_reader
abstraction. These permutations should cover all the existing 24 variants in the original file and much more (at time of writing it hits 1300 permutations). I have put enough info in thedebuglog('test')
to recreate the permutation if you are trying to track down what broke, but it isn't ideal.