Closed
Bug 1316729
Opened 6 years ago
Closed 6 years ago
gtest death tests don't work on Windows
Categories
(Testing :: General, defect)
Tracking
(firefox53 fixed)
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: erahm, Assigned: erahm)
Details
Attachments
(1 file)
2.92 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
In bug 1316437 we noticed that death tests don't work on Windows. Judging from test logs it looked like all gtests would run, it would hit the death test, spawn a new process, all gtests would run, it would hit the death test, spawn a new process, ad infinium. I'm not sure if it has to do with our hacks to gtest or if it's a bug that's been fixed upstream. To reproduce you can run the windows equivalent of: > GTEST_ALSO_RUN_DISABLED_TESTS=0 ./mach gtest STLWrapper*
Comment 1•6 years ago
|
||
This is almost certainly because Windows lacks fork(), so gtest probably does some fiddling under the hood to re-launch the current process. I don't know that we'll be able to fix this unless gtest offers hooks for customizing that behavior.
Assignee | ||
Comment 2•6 years ago
|
||
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #1) > This is almost certainly because Windows lacks fork(), so gtest probably > does some fiddling under the hood to re-launch the current process. I don't > know that we'll be able to fix this unless gtest offers hooks for > customizing that behavior. In theory it's supposed to launch a new process and run the test, so the question is why it's not doing that. I would guess our gtest main hook isn't reading command-line args.
Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Eric Rahm [:erahm] from comment #2) > (In reply to Ted Mielczarek [:ted.mielczarek] from comment #1) > > This is almost certainly because Windows lacks fork(), so gtest probably > > does some fiddling under the hood to re-launch the current process. I don't > > know that we'll be able to fix this unless gtest offers hooks for > > customizing that behavior. > > In theory it's supposed to launch a new process and run the test, so the > question is why it's not doing that. I would guess our gtest main hook isn't > reading command-line args. That definitely appears to be the problem, we implement our own main and initialize without passing in args [1], vs the standard gtest main which does [2]. The Windows death test spawns a new process and needs to pass it args indicating this is a child death test [3], but of course those aren't parsed because of [1]. [1] http://searchfox.org/mozilla-central/rev/4b6cab91f93c73ae591dafaea40fd5704b41810e/testing/gtest/mozilla/GTestRunner.cpp#82 [2] http://searchfox.org/mozilla-central/rev/4b6cab91f93c73ae591dafaea40fd5704b41810e/testing/gtest/gtest/src/gtest_main.cc#37 [3] http://searchfox.org/mozilla-central/rev/4b6cab91f93c73ae591dafaea40fd5704b41810e/testing/gtest/gtest/src/gtest-death-test.cc#639-643
Assignee | ||
Comment 4•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=096c1b8440c3
Assignee | ||
Comment 5•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=4d200c3a1d76
Assignee | ||
Comment 6•6 years ago
|
||
MozReview-Commit-ID: 8Xs52E9NnCq
Attachment #8810492 -
Flags: review?(ted)
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Comment 7•6 years ago
|
||
Comment on attachment 8810492 [details] [diff] [review] Pass command-line args to gtest stealing review
Attachment #8810492 -
Flags: review?(ted) → review+
Assignee | ||
Comment 8•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8df58dfdea13c9c79975abb4e0c6514b1b4da5f6 Bug 1316729 - Pass command-line args to gtest. r=ted
Comment 9•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/8df58dfdea13
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in
before you can comment on or make changes to this bug.
Description
•