Closed Bug 1285059 Opened 3 years ago Closed 3 years ago

Native messaging tests use signal.pause() which does not exist on Windows

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set

Tracking

(firefox50 fixed)

RESOLVED FIXED
mozilla50
Iteration:
50.3 - Jul 18
Tracking Status
firefox50 --- fixed

People

(Reporter: aswan, Assigned: aswan)

Details

(Whiteboard: triaged)

Attachments

(1 file)

No description provided.
Iteration: --- → 50.3 - Jul 18
https://reviewboard.mozilla.org/r/62752/#review59802

::: toolkit/components/extensions/test/mochitest/test_chrome_ext_native_messaging.html:92
(Diff revision 1)
>  signal.signal(signal.SIGTERM, signal.SIG_IGN)
>  
>  while True:
>      rawlen = sys.stdin.read(4)
>      if len(rawlen) == 0:
> -        signal.pause()
> +        time.sleep(5)

Can we continue to use `signal.pause` where it exists? It's closer to what we'll see on real unix systems. Either way, we should put the sleep calls in an infinite loop. This shouldn't be timing dependent.
https://reviewboard.mozilla.org/r/62752/#review59802

> Can we continue to use `signal.pause` where it exists? It's closer to what we'll see on real unix systems. Either way, we should put the sleep calls in an infinite loop. This shouldn't be timing dependent.

I didn't follow the last comment, what is timing dependent here?  Also the sleep calls are in an infinite loop, are you asking to have a nested loop?  I don't really see any practical difference.
https://reviewboard.mozilla.org/r/62752/#review59802

> I didn't follow the last comment, what is timing dependent here?  Also the sleep calls are in an infinite loop, are you asking to have a nested loop?  I don't really see any practical difference.

If the script isn't killed within 5 seconds, `sleep()` returns, execution continues to the next line, `struct.unpack` throws because the string isn't long enough, and the script exits on its own.
https://reviewboard.mozilla.org/r/62752/#review59802

> If the script isn't killed within 5 seconds, `sleep()` returns, execution continues to the next line, `struct.unpack` throws because the string isn't long enough, and the script exits on its own.

oh duh, sure enough
Comment on attachment 8768597 [details]
Bug 1285059 Do not use signal.pause

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/62752/diff/1-2/
Attachment #8768597 - Flags: review- → review?(kmaglione+bmo)
https://hg.mozilla.org/mozilla-central/rev/82ae790de988
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.