Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Make JS code hint test runs more consistent #5904

Merged
merged 4 commits into from
Nov 11, 2013
Merged

Conversation

dangoor
Copy link
Contributor

@dangoor dangoor commented Nov 8, 2013

I changed the resetting behavior for code hint tests to eliminate uncertainty that is causing some test failures. This change also adds some scaffolding that makes it easier to track down JS code hint issues.

Hopefully fixes #5754. This definitely fixes #5811.

Previously, the web worker would be restarted at somewhat random
times during test runs (after a specific number of hints was requested).
This change forces the worker to start afresh with each test and switches
the worker so that it doesn't reset during any of the tests.
@ghost ghost assigned jasonsanjose Nov 8, 2013
@jasonsanjose
Copy link
Member

Assigned to me

@@ -778,6 +782,9 @@ define(function (require, exports, module) {
*/
function postMessage(msg) {
addFilesPromise.done(function (ternWorker) {
if (config.debug) {
console.debug("Sending message", msg);
Copy link
Member

Choose a reason for hiding this comment

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

Nit. Looks like console.debug is deprecated. https://developer.mozilla.org/en-US/docs/Web/API/console

Copy link
Member

Choose a reason for hiding this comment

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

The Chrome docs don't say that, though it sounds identical to regular .log() there too... https://developers.google.com/chrome-developer-tools/docs/console

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, Firebug hasn't deprecated console.debug either. I kind of liked debug because Chrome shows the debug messages in blue, making them a bit easier to pick out.

@jasonsanjose
Copy link
Member

Initial review complete

@dangoor
Copy link
Contributor Author

dangoor commented Nov 11, 2013

@jasonsanjose I've just pushed a commit that addresses the comments. The only one I didn't directly address is the if (config.debug) one. Take a look at my response to your comment and let me know what you think. Thanks!

@dangoor
Copy link
Contributor Author

dangoor commented Nov 11, 2013

Err, just looked at my todo list and realized that I have another change to make (setConfig in tern-worker taking the whole config rather than merging it)

@dangoor
Copy link
Contributor Author

dangoor commented Nov 11, 2013

OK, updated setConfig in tern-worker.

@jasonsanjose
Copy link
Member

Looks good. Merging.

jasonsanjose added a commit that referenced this pull request Nov 11, 2013
Make JS code hint test runs more consistent
@jasonsanjose jasonsanjose merged commit 3e772fd into master Nov 11, 2013
@jasonsanjose jasonsanjose deleted the dangoor/jshints-tests branch November 11, 2013 21:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants