Closed Bug 475455 Opened 15 years ago Closed 15 years ago

[Windows 2000] runtests.py: automation.py can't kill ssltunnel.exe

Categories

(Testing :: Mochitest, defect)

x86
Windows 2000
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: sgautherie, Assigned: sgautherie)

References

Details

(Keywords: dogfood, regression, Whiteboard: [fixed1.9.1b4] ['kill.exe' url: comment 8])

Attachments

(1 file, 1 obsolete file)

[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090124 SeaMonkey/2.0a3pre] (experimental/_m-c_, home, optim default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/096ab3b6abe0
 +http://hg.mozilla.org/comm-central/rev/176d86062c81)

Passes.

[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090126 SeaMonkey/2.0a3pre] (experimental/_m-c_, home, optim default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/7d9bea3fa51a
 +http://hg.mozilla.org/comm-central/rev/3fc9e562a8ee)

Example running a11y test suite:
{
Server pid: 564
pk12util.exe: PKCS12 IMPORT SUCCESSFUL
SSL tunnel pid: 1916
Application pid: 1536
failed to bind socket
Shutting down...
### XPCOM_MEM_BLOAT_LOG defined -- logging bloat/leaks to ...\mozilla\_tests\testing\mochitest\mochitesttestingprofile/leaks-report.log
search "file" not found - skipping.
Error loading URL http://localhost:8888/redirect-a11y.html?autorun=1&closeWhenDone=1&logFile=SM_9-A11y_.log&fileLevel=INFO : 804b0002 (NS_BINDING_ABORTED)
Document chrome://mochikit/content/harness-a11y.xul?autorun=1&closeWhenDone=1&logFile=SM_9-A11y_.log&fileLevel=INFO loaded successfully
Redirecting output to win32trace remote collector
Traceback (most recent call last):
  File "runtests.py", line 491, in <module>
    main()
  File "runtests.py", line 303, in main
    PROFILE_DIRECTORY, options.browserArgs)
  File "...\mozilla\_tests\testing\mochitest\automation.py", line 384, in runApp
    ssltunnelProcess.kill()
  File "...mozilla\_tests\testing\mochitest\automation.py", line 65, in kill
    subprocess.Popen(["taskkill", "/F", "/PID", pid]).wait()
  File "...\Lib\subprocess.py", line 594, in __init__
    errread, errwrite)
  File "...\Lib\subprocess.py", line 822, in _execute_child
    startupinfo)
WindowsError: [Error 2] Le fichier spÚcifiÚ est introuvable
}

Notice
*at beginning, "failed to bind socket" + "Shutting down..."
*at end, "file not found" error

(3 days) Regression timeframe(s):
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=096ab3b6abe0&tochange=7d9bea3fa51a
http://hg.mozilla.org/comm-central/pushloghtml?fromchange=176d86062c81&tochange=3fc9e562a8ee
(In reply to comment #0)
> *at beginning, "failed to bind socket" + "Shutting down..."

Forget about this part:
the error at the end leaves 1 xpcshell.exe and 1 ssltunnel.exe stuck processes...

Making a guess: bug 464191 !?
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090127 SeaMonkey/2.0a3pre] (experimental/_m-c_, home, optim default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/d4b802e1f201
 +http://hg.mozilla.org/comm-central/rev/9fb7643249d9)

(3+3 checkins) Regression timeframe(s):
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=096ab3b6abe0&tochange=d4b802e1f201
http://hg.mozilla.org/comm-central/pushloghtml?fromchange=176d86062c81&tochange=9fb7643249d9
(In reply to comment #1)
> Making a guess: bug 464191 !?

Confirmed by local backout.

In addition to the stuck processes, this bug prevents the leak report from running.
Blocks: 464191
Severity: normal → major
Keywords: dogfood
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090127 Minefield/3.2a1pre] (home, optim default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/13e95c7ff78b + bug 446300 patch)

Firefox has regressed too.
Summary: [SeaMonkey] ssl tunnel / runtests.py fail now → ssl tunnel / runtests.py fail now
This is only on your local Windows 2000 system, right?  Google claims taskkill is XP+ and kill was Windows 2000, so the name of the kill utility might need to vary based on the Windows version.  We swallowed this exception silently prior to 464191's checkin, for what it's worth.
(In reply to comment #5)
> This is only on your local Windows 2000 system, right?

Yes, afaict.

> Google claims taskkill is XP+ and kill was Windows 2000,
> so the name of the kill utility might need to vary based on the Windows version.

I don't have either of them.

My Google search agrees with yours,
but seems to report that kill.exe is part of some "Windows 2000 Resource Kit tools".
I don't know about WinXP.

Maybe some kill utility should be shipped with mozbuild ?

> We swallowed this exception silently prior to 464191's checkin

Prior to that checkin, I had to Ctrl+C to kill whatever process was still running at the end of runtests.py.
Shipped just for Windows 2000?  I wouldn't spend time adding it to mozillabuild, given it's getting somewhat obsolete as Windows OSes go; I think you're on your own on getting this working.  Requiring installation of the resource kit doesn't seem unreasonable to me, tho.
Ftr, some links:

http://support.microsoft.com/?scid=kb%3Ben-us%3B927229
Windows 2000 Resource Kit Tools for administrative tasks
doesn't list this utility :-/

http://support.microsoft.com/?scid=kb%3Ben-us%3B301423
How to install the Windows 2000 Support Tools to a Windows 2000 Server-based computer
lists it, but refers to the Win2K install CD...

http://www.petri.co.il/download_free_reskit_tools.htm
Where can I download the Windows 2000 Resource Kit tools?
has it as a 5 kB download ! :-)
Summary: ssl tunnel / runtests.py fail now → [Windows 2000] runtests.py: automation.py can't kill ssltunnel.exe
Whiteboard: ['kill.exe' url: comment 8]
Target Milestone: --- → mozilla1.9.2a1
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20090127 Minefield/3.2a1pre] (home, optim default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/13e95c7ff78b + bug 446300 patch)

With the utility in my path, I successfully get:
{
...
SSL tunnel pid: 1772
...
process ssltunnel.exe (1772) - '' killed
...
}

I guess this requirement should be documented somewhere...
Assignee: nobody → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #359200 - Flags: review?(jwalden+bmo)
Av1, using |log.info("ERROR FAIL ...|
Attachment #359200 - Attachment is obsolete: true
Attachment #359204 - Flags: review?(jwalden+bmo)
Attachment #359200 - Flags: review?(jwalden+bmo)
Comment on attachment 359204 [details] [diff] [review]
(Av1a) Support Win2K kill.exe tool
[Checkin: See comment 12 & 14]

>+      if (platform.release() == "2000"):

Nix the superfluous parentheses around the condition.


>+          log.info("ERROR FAIL Missing 'kill' utility to kill process with pid=%s. Kill it manually !" % pid)

I'm not entirely sure the message here should be errorful, but I'm not entirely sure it shouldn't be, so whatever.  (Not to mention it's only affecting Windows 2000 users anyway.)

I think you can just use log.info("....%s....", pid) here, so please use that assuming it works.

r=me with those changes
Attachment #359204 - Flags: review?(jwalden+bmo) → review+
Comment on attachment 359204 [details] [diff] [review]
(Av1a) Support Win2K kill.exe tool
[Checkin: See comment 12 & 14]


http://hg.mozilla.org/mozilla-central/rev/a875074e665d
Av1b: Av1a with (2/3) comment 11 suggestions.
Attachment #359204 - Attachment description: (Av1a) Support Win2K kill.exe tool → (Av1a) Support Win2K kill.exe tool [Checkin: See comment 12]
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
No longer blocks: CcMcBuildIssues
Fwiw,

Today, I ran |make mochitest-*| from (Msys) bash,
instead of |python runtests.py ...| from (Win2K) cmd.exe.
(See bug 479225 ;-))

0)
As a reminder:
http://docs.python.org/library/os.html
"os.kill(pid, sig) [...] Availability: Unix." :-/

1)
Comment 9 solution applies to MSys Bash too :-)

2)
I also found
http://www.python.org/doc/faq/windows/#how-do-i-emulate-os-kill-in-windows
"Use win32api [...]"
and
http://sourceforge.net/projects/pywin32/
"Python Extensions for Windows"
which is supposed to install that extension.

Yet, to install all that package (for this issue only) seemed overkill, given solution 1 :-|

(I would still be interested in this if someone tries it.)

3)
Actually, MSys Bash has an integrated 'kill' command:
{
$ kill

kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
}

The idea would be to use something +/- like
|subprocess.Popen(["kill", pid], shell = True).wait()|

But
http://docs.python.org/library/subprocess.html#module-subprocess
"On Windows, the default shell is specified by the COMSPEC environment variable."
Then I don't know how to "easily" have Python to call (mozbuild/MSys) Bash instead of (Win2K) cmd.exe,
even with something +/- like |, executable = "/bin/bash"| :-(
"easily" meanning "how do I retrieve the (Windows) path to the installed bash ?"...
In other words, how to get Python to notice it's running from Bash, not Cmd ?

(I would still be interested in this if someone knows more than the little I do.)
Whiteboard: ['kill.exe' url: comment 8] → [needs 1.9.1 landing: after bug 464191] ['kill.exe' url: comment 8]
Comment on attachment 359204 [details] [diff] [review]
(Av1a) Support Win2K kill.exe tool
[Checkin: See comment 12 & 14]


http://hg.mozilla.org/releases/mozilla-1.9.1/rev/21282ecf820f

After fixing context for:
{
unable to find 'build/pgo/automation.py.in' for patching
1 out of 1 hunks FAILED
}
Attachment #359204 - Attachment description: (Av1a) Support Win2K kill.exe tool [Checkin: See comment 12] → (Av1a) Support Win2K kill.exe tool [Checkin: See comment 12 & 14]
Flags: in-testsuite-
Whiteboard: [needs 1.9.1 landing: after bug 464191] ['kill.exe' url: comment 8] → [fixed1.9.1b4] ['kill.exe' url: comment 8]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: