Skip to content

Fix flapping test-suite tests - #2610

Merged
lucaswoj merged 3 commits into
masterfrom
flapping-test-suite
May 23, 2016
Merged

lucaswoj merged 3 commits into
masterfrom
flapping-test-suite

Conversation

@lucaswoj

Copy link
Copy Markdown
Contributor

@lucaswoj
lucaswoj force-pushed the flapping-test-suite branch from a7664b4 to 8057fbb Compare May 23, 2016 20:42
@lucaswoj

Copy link
Copy Markdown
Contributor Author

This PR changes the semantics of the wait command in the operations array in test-suite. The wait operation now waits for a fully-loaded render to occur. Because of this change, we can make test-suite fully backwards compatible in the case that there are no operations.

Comment thread test/suite_implementation.js Outdated
applyOperations(map, operations.slice(1), callback);
}
applyOperations(map, operations.slice(1), callback);
} catch (e) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wrapping callback() with a try/catch that also calls callback is dangerous -- if callback throws, it'll get called twice. What happens if we don't do any exception handling here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. I will restructure to move callback out of the error handler.

What happens if we don't do any exception handling here?

If we don't do any error handling and there is a synchronous error (there were several in my testing) some global exception handler (not the default one) gets triggered. This handler is awful for debugging because it prints the error message (i.e. "undefined is not a function") without any stracktrace.

@jfirebaugh jfirebaugh May 23, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It gets caught by the exception handler in map, emitted as an error event, and logged by the default handler. I guess this is a difference in how node and a browser handle console.log(error) -- the browser behavior of logging the stack trace being much more useful.

What about having suite_implementation.js bind an error handler that does more complete logging? This would be helpful in general for any time the test-suite happens to cause an error in gl-js internals.

@jfirebaugh

Copy link
Copy Markdown
Contributor

Confirmed that this fixes test suite hangs for me. 👍

@lucaswoj
lucaswoj force-pushed the flapping-test-suite branch from f24263c to 4f8ec43 Compare May 23, 2016 21:36
@lucaswoj

Copy link
Copy Markdown
Contributor Author

@jfirebaugh 🚢 on 🍏?

@jfirebaugh

Copy link
Copy Markdown
Contributor

🚢

@lucaswoj
lucaswoj force-pushed the flapping-test-suite branch from d25048c to 5ed4946 Compare May 23, 2016 23:02
@lucaswoj

Copy link
Copy Markdown
Contributor Author

I fixed the new problem by setting map.repaint = true, configuring the render loop to never stop running. Given how hard it is to debug a problem that is only reproducible on Circle CI, I am going to merge this to unblock our contributors and seek better solutions separately.

@lucaswoj
lucaswoj merged commit 5dd2dee into master May 23, 2016
@lucaswoj
lucaswoj deleted the flapping-test-suite branch May 23, 2016 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants