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
Warnings when running in CSP mode #15852
Comments
If test.dart sees FAIL and PASS it will report the test as FAIL'ed (the warning is just printed to surface this situation). bool get _browserTestFailure { Looking at html/custom/js_custom_test for example, we can see it was marked as failing on dart2js-csp in the html.status file. Now we come to the reason why there can be FAIL and PASS in the output:* Our normal contract with tests is:
test_controller.js will intercept these messages and is able to correctly mark the test as passing or failing.
* BUT we have some tests using the unittest framework (in particular tests/html/*). The unittest framework does not use "unittest-suite-success/unittest-suite-fail" when a test is done.
Since we know that we have this (incorrect) behavior from unittest, test.dart will grep for FAIL in the DOM (both when using content_shell and when browser controller) and mark the test as failing when a 'FAIL' was found in the DOM. [As can be seen in the output above, the corresponding tests are all from the "html" test suite. All of these tests use the unittest framework.] To summarize, there are two issues: b) when running tests inside content_shell the only information test.dart gets currently is the DOM, wo we have to use it as communication channel (i.e. test_controller.js has to print the outcome to the DOM). The fundamental issue is a). I've tried to solve it by changing unittest framework (see https://codereview.chromium.org/75393002/diff/110001/pkg/unittest/lib/html_config.dart), but I was told to not commit this CL. |
The unittest frameworks throws an exception when a test fails and does not print PASS. This should be sufficient for test_controller.js. I think you're saying that is not the case anymore, and then something must have regressed in either test_controller.js or unittest. |
@ahe: I think it works roughly like this:
Almost all of the tests inside tests/html/* use either
The way the unittest framework surfaces the test results depends on the configuration that is being used. The html configurations print a nice looking table into the DOM once the test is done (with formatted stack traces ...). There are no uncaught exceptions on window.onerror. But maybe I'm overlooking something? |
@martin: Let's look at this together soon. It sounds to me like something isn't right with some of the configurations. The intent was, AFAIK, to always throw an exception if there was an error. I can already tell that something is fishy by looking at the default implementation of Configuration.onDone. It must throw an exception if success is false. Also, someone added throwOnTestFailures which makes it optional n SimpleConfiguration. |
I'm guessing we no longer care about ContentShell. |
Running
./tools/test.py -mrelease -cdart2js --time -pcolor --report --failure-summary -rdrt --csp
produces warnings (see below).
I do not understand the benefit of warning on the console but not marking a test as failing. Most people don't test --csp locally, and will never see these warnings.
Please do not reassign this bug to dart2js. I'm not reporting a bug in dart2js, I'm reporting an issue in the test runner (warnings, not test failures).
[01:25 | 4% | + 125 | - 0]2014-01-02 13:32:12.504 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/pkg_polymer_example_canonicalization_test_canonicalization_test/test/canonicalization_test.html?crossOriginPort=64001)
2014-01-02 13:32:12.509 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/pkg_polymer_example_canonicalization_test_canonicalization_test/test/canonicalization_test.html?crossOriginPort=64001)
[01:26 | 4% | + 126 | - 0]2014-01-02 13:32:12.509 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/pkg_polymer_example_canonicalization_test_canonicalization_test/test/canonicalization_test.html?crossOriginPort=64001)
[02:14 | 7% | + 209 | - 0]2014-01-02 13:32:59.942 Warning: HttpServer: could not find file for request path: "/root_build/generated_tests/dart2js-drt-csp/pkg_template_binding_test_template_binding_test/pic.jpg"
[02:44 | 9% | + 280 | - 0]2014-01-02 13:33:31.014 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/samples_swarm_test_swarm_ui_lib_touch_touch_test/test.html?crossOriginPort=64001)
2014-01-02 13:33:31.015 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/samples_swarm_test_swarm_ui_lib_touch_touch_test/test.html?crossOriginPort=64001)
[02:45 | 9% | + 281 | - 0]2014-01-02 13:33:31.016 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/samples_swarm_test_swarm_ui_lib_touch_touch_test/test.html?crossOriginPort=64001)
[02:50 | 10% | + 297 | - 0]2014-01-02 13:33:36.323 Warning: HttpServer: could not find file for request path: "/root_build/generated_tests/dart2js-drt-csp/samples_swarm_test_swarm_test/data/Test0_2_1.html"
[04:06 | 18% | + 545 | - 0]2014-01-02 13:34:52.765 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_custom_created_callback_test/test.html?crossOriginPort=64001)
2014-01-02 13:34:52.766 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_custom_created_callback_test/test.html?crossOriginPort=64001)
[04:06 | 18% | + 546 | - 0]2014-01-02 13:34:52.767 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_custom_created_callback_test/test.html?crossOriginPort=64001)
[04:08 | 18% | + 559 | - 0]2014-01-02 13:35:03.009 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_custom_js_custom_test/test.html?crossOriginPort=64001)
2014-01-02 13:35:03.010 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_custom_js_custom_test/test.html?crossOriginPort=64001)
[04:17 | 18% | + 560 | - 0]2014-01-02 13:35:03.011 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_custom_js_custom_test/test.html?crossOriginPort=64001)
[04:27 | 19% | + 577 | - 0]2014-01-02 13:35:13.506 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_event_customevent_test/test.html?crossOriginPort=64001)
2014-01-02 13:35:13.507 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_event_customevent_test/test.html?crossOriginPort=64001)
[04:27 | 19% | + 578 | - 0]2014-01-02 13:35:13.520 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_event_customevent_test/test.html?crossOriginPort=64001)
[05:37 | 25% | + 761 | - 0]2014-01-02 13:36:23.774 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_webgl_1_test/test.html?crossOriginPort=64001&group=functional)
2014-01-02 13:36:23.775 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_webgl_1_test/test.html?crossOriginPort=64001&group=functional)
2014-01-02 13:36:23.781 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_webgl_1_test/test.html?crossOriginPort=64001&group=functional)
2014-01-02 13:36:23.781 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_webgl_1_test/test.html?crossOriginPort=64001&group=functional)
[05:37 | 25% | + 762 | - 0]2014-01-02 13:36:23.783 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_webgl_1_test/test.html?crossOriginPort=64001&group=functional)
[05:38 | 25% | + 764 | - 0]2014-01-02 13:36:23.966 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_wheelevent_test/test.html?crossOriginPort=64001)
2014-01-02 13:36:23.966 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_wheelevent_test/test.html?crossOriginPort=64001)
[05:38 | 25% | + 765 | - 0]2014-01-02 13:36:23.967 Warning: Test had 'FAIL' and 'PASS' in stdout. ("/Users/ahe/Dart/all/dart//client/tests/drt/Content Shell.app/Contents/MacOS/Content Shell" --no-timeout --dump-render-tree http://127.0.0.1:64000/root_build/generated_tests/dart2js-drt-csp/tests_html_wheelevent_test/test.html?crossOriginPort=64001)
[05:38 | 25% | + 768 | - 0]2014-01-02 13:36:24.489 Warning: HttpServer: could not find file for request path: "/root_build/generated_tests/dart2js-drt-csp/tests_html_worker_test/worker.js"
[05:38 | 25% | + 769 | - 0]2014-01-02 13:36:24.862 Warning: HttpServer: could not find file for request path: "/root_build/generated_tests/dart2js-drt-csp/tests_html_xhr_cross_origin_test/does_not_exist"
[08:34 | 52% | + 1558 | - 0]
The text was updated successfully, but these errors were encountered: