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: changed test1 of test-vm-timeout.js so that entire error message would be matched #11590

Closed
wants to merge 3 commits into from

Conversation

moe-dizzle
Copy link
Contributor

Before test 1 of test-vm-timeout.js would match any error, now it looks specifically for the error message "Script execution timed out."

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

…e would be matched

Before test 1 of test-vm-timeout.js would match any error,
now it looks specifically for the error message "Script execution timed out."
@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Feb 27, 2017
@mscdex mscdex added the vm Issues and PRs related to the vm subsystem. label Feb 27, 2017
@@ -6,6 +6,9 @@ const vm = require('vm');
// Test 1: Timeout of 100ms executing endless loop
assert.throws(function() {
vm.runInThisContext('while(true) {}', { timeout: 100 });
}, function(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think using a regexp as the second argument would be more succinct: /^Error: Script execution timed out\.$/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha I agree with you before when I tried /^Script execution timed out.$/ it didn't work, so I did the above approached. I didn't realize that "Error: " was included also. Awesome I will correct it!

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM

@Trott
Copy link
Member

Trott commented Feb 27, 2017

@mscdex
Copy link
Contributor

mscdex commented Feb 27, 2017

LGTM

@addaleax
Copy link
Member

addaleax commented Mar 5, 2017

Landed in 94d1c8d, thanks for the PR!

@addaleax addaleax closed this Mar 5, 2017
addaleax pushed a commit that referenced this pull request Mar 5, 2017
test: changed test1 of test-vm-timeout.js so that entire error message
would be matched in assert.throw.

Before test 1 of test-vm-timeout.js would match any error,
now it looks specifically for the error message
"Script execution timed out."

PR-URL: #11590
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
addaleax pushed a commit that referenced this pull request Mar 5, 2017
test: changed test1 of test-vm-timeout.js so that entire error message
would be matched in assert.throw.

Before test 1 of test-vm-timeout.js would match any error,
now it looks specifically for the error message
"Script execution timed out."

PR-URL: #11590
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@evanlucas evanlucas mentioned this pull request Mar 8, 2017
MylesBorins pushed a commit that referenced this pull request Apr 17, 2017
test: changed test1 of test-vm-timeout.js so that entire error message
would be matched in assert.throw.

Before test 1 of test-vm-timeout.js would match any error,
now it looks specifically for the error message
"Script execution timed out."

PR-URL: #11590
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
test: changed test1 of test-vm-timeout.js so that entire error message
would be matched in assert.throw.

Before test 1 of test-vm-timeout.js would match any error,
now it looks specifically for the error message
"Script execution timed out."

PR-URL: #11590
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
test: changed test1 of test-vm-timeout.js so that entire error message
would be matched in assert.throw.

Before test 1 of test-vm-timeout.js would match any error,
now it looks specifically for the error message
"Script execution timed out."

PR-URL: nodejs/node#11590
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
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. vm Issues and PRs related to the vm subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants