Closed Bug 543438 Opened 12 years ago Closed 12 years ago

TestBlockingProcess relies on stdin to "block"

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a4

People

(Reporter: glandium, Assigned: glandium)

Details

Attachments

(1 file, 1 obsolete file)

The sole purpose of the TestBlockingProcess program is to live long enough to be able to kill it from the nsIProcess unit test. It currently relies on stdin to block, which is both a wrong assumption and an accurate way to have the nsIProcess unit test fail some particular environments (probably with the help of another bug in either nsProcess or NSPR, depending how one regards the issue, that I'll file right after this one).

Such particular environments include those where stdin is not a tty (and it so happens in some Debian build environments, such as pbuilder).

The result is that depending on the environment, TestBlockingProcess may or may not be "blocking". As its sole purpose is to be alive long enough to be killed by the nsIProcess unit test, it'd be just fine to loop on a sleep() call.
Attached patch Patch (obsolete) — Splinter Review
Assignee: nobody → mh+mozilla
Attachment #424567 - Flags: review?(benjamin)
Attachment #424567 - Flags: review?(benjamin) → review?(dtownsend)
Attachment #424567 - Flags: review?(dtownsend) → review+
Status: NEW → ASSIGNED
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/4c8952703e77
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a3
Backed out.

e:/builds/moz2_slave/mozilla-central-win32/build/xpcom/tests/TestBlockingProcess.cpp(1) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1267790762.1267791982.4339.gz
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla1.9.3a3 → ---
(In reply to comment #3)
> Backed out.
> 
> e:/builds/moz2_slave/mozilla-central-win32/build/xpcom/tests/TestBlockingProcess.cpp(1)
> : fatal error C1083: Cannot open include file: 'unistd.h': No such file or
> directory
> 
> http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1267790762.1267791982.4339.gz

Really, I'm puzzled. unistd.h is a standard header, and it's used all over the place in the source... O_o
So, apparently, this should be protected in a #if !defined(XP_WIN) && !defined(XP_OS2)
I don't know where sleep() is supposed to be defined on these.
It'd be better to use PR_Sleep, I guess. Let me try that.
Attached patch Patch v2Splinter Review
This one should work everywhere
Attachment #424567 - Attachment is obsolete: true
Attachment #430601 - Flags: review?(dtownsend)
Attachment #430601 - Flags: review?(dtownsend) → review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/4fc56018e4c5
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a4
You need to log in before you can comment on or make changes to this bug.