Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Issue 21220004: Split unittest tests into separate test files. (Closed)

Created:
7 years, 4 months ago by gram
Modified:
7 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Split unittest tests into separate test files. For now we replicate the status for all the tests in some cases (e.g. FireFox flakiness), but after this is committed we can re-enable these tests to try to isolate flaky test cases more narrowly. R=sigmund@google.com Committed: https://code.google.com/p/dart/source/detail?r=25670

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+763 lines, -482 lines) Patch
M pkg/pkg.status View 2 chunks +3 lines, -3 lines 0 comments Download
A pkg/unittest/test/unittest_async_exception_test.dart View 1 chunk +21 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_async_setup_teardown_test.dart View 1 chunk +64 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_completion_test.dart View 1 chunk +27 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_correct_callback_test.dart View 1 chunk +19 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_exception_test.dart View 1 chunk +19 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_excess_callback_test.dart View 1 chunk +28 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_late_exception_test.dart View 1 chunk +27 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_middle_exception_test.dart View 1 chunk +27 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_nested_groups_setup_teardown_test.dart View 1 chunk +43 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_runtests_without_tests_test.dart View 1 chunk +18 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_setup_and_teardown_test.dart View 1 chunk +23 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_setup_test.dart View 1 chunk +24 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_single_correct_test.dart View 1 chunk +18 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_single_failing_test.dart View 1 chunk +19 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_skipped_soloed_nested_test.dart View 1 chunk +77 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_teardown_test.dart View 1 chunk +22 lines, -0 lines 0 comments Download
D pkg/unittest/test/unittest_test.dart View 1 chunk +0 lines, -479 lines 0 comments Download
A pkg/unittest/test/unittest_test_returning_future_test.dart View 1 chunk +62 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_test_returning_future_using_runasync_test.dart View 1 chunk +83 lines, -0 lines 0 comments Download
A pkg/unittest/test/unittest_test_utils.dart View 1 chunk +95 lines, -0 lines 2 comments Download
A pkg/unittest/test/unittest_testcases_immutable_test.dart View 1 chunk +21 lines, -0 lines 0 comments Download
A pkg/unittest/test/unitttest_group_name_test.dart View 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
gram
7 years, 4 months ago (2013-07-30 20:10:28 UTC) #1
Siggi Cherem (dart-lang)
lgtm (I assumed you just moved code around, but that there is no "new" logic ...
7 years, 4 months ago (2013-07-30 23:37:04 UTC) #2
gram
Committed patchset #1 manually as r25670 (presubmit successful).
7 years, 4 months ago (2013-07-31 17:03:20 UTC) #3
kustermann
7 years, 4 months ago (2013-08-02 12:41:01 UTC) #4
Message was sent while issue was closed.
For this specific CL: Thank you for splitting up unittest_test.dart into smaller
tests.


In general: I'm not too happy with the approach taken. Here are a few thoughts:

A lot of tests in the dart repository use the unittest framework. Which means
that unittest is a crucial piece of software. If it contained a bug, we can't
rely on our tests/green-buildbot-state/.... We get wrong confidence about the
state of the dart platform.

unittest_test_utils.dart changes the semantics of how unittest works (you're
subclassing Configuration and overriding methods).
If we want to make sure that the unittest framework is doing what it is supposed
to do, we should not change it's behaviour.

Blackbox tests could help there.

One example: By just briefly looking, I cannot find a test which ensures that if
a test (which uses pkg/unittest) fails, that the exitCode is nonzero. The
testing driver is relying on that fact.

https://codereview.chromium.org/21220004/diff/1/pkg/unittest/test/unittest_te...
File pkg/unittest/test/unittest_test_utils.dart (right):

https://codereview.chromium.org/21220004/diff/1/pkg/unittest/test/unittest_te...
pkg/unittest/test/unittest_test_utils.dart:57: _port.send(_result);
You are overriding a method here!

'Configuration.onInit()' does:
- create a new ReceivePort
- print "unittest-suite-wait-for-done"

'Configuration.onDone()' does:
- close the ReceivePort opened by 'Configuration.onInit()'
- print "unittest-suite-success"

There are two issues here:

a) By overriding 'Configuration.onDone()' and not calling the 'super.onDone()'
you leak the ReceivePort, which means that the isolate will stay alive. I'm
highly confident that this was  the reason why we got an out-of-memory crashes
of unittest_test.dart on DRT/ContentShell.

b) Even though you run some parts of the unittest framework in an isolate, you
are still printing the "unittest-suite-wait-for-done" messages. These have a
semantic meaning: These messages are used to communicate with the testing
driver.

In particular b) is very crucial: please make sure that the tests you run inside
an isolate have no side-effects / don't communicate with the testing driver.

https://codereview.chromium.org/21220004/diff/1/pkg/unittest/test/unittest_te...
pkg/unittest/test/unittest_test_utils.dart:94: });
How do you ensure that this closure will be called in the future?

Powered by Google App Engine
This is Rietveld 408576698