Skip to content

Commit

Permalink
Bug 1492873 [wpt PR 13113] - Handle case where mozlog is not installe…
Browse files Browse the repository at this point in the history
…d., a=testonly

Automatic update from web-platform-testsHandle case where mozlog is not installed. (#13113)

In case that mozlog is present we need to ensure any lock it holds is
released in subprocesses. In case it's not present we don't need to do
anything, so don't fail if we can't import it.

Fixes web-platform-tests/wpt#13112.
--

wpt-commits: 1f8fa9e610d934490538812d6121a77baf646bfc
wpt-pr: 13113

UltraBlame original commit: ba995f8b27019322f6b01edc29c7d061145fba02
  • Loading branch information
marco-c committed Oct 3, 2019
1 parent b342045 commit b370f60
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion testing/web-platform/meta/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -4402298,7 +4402298,7 @@ py
:
[
"
e8c6af20857d210aef792f7d78aaddd3fdd8adcf
8f95bd492322a65a5bbb78430734b769730d9e35
"
"
support
Expand Down
78 changes: 40 additions & 38 deletions testing/web-platform/tests/tools/serve/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@
js_meta_re
parse_variants
from
mozlog
.
structuredlog
import
StructuredLogger
from
wptserve
import
server
Expand Down Expand Up @@ -5032,6 +5026,44 @@
=
None
def
release_mozlog_lock
(
)
:

try
:

from
mozlog
import
StructuredLogger

try
:

StructuredLogger
.
_lock
.
release
(
)

except
threading
.
ThreadError
:

pass

except
ImportError
:

pass
def
start_ws_server
(
host
Expand Down Expand Up @@ -5075,25 +5107,10 @@
logging
)

try
:

StructuredLogger
.
_lock
.
release
release_mozlog_lock
(
)

except
threading
.
ThreadError
:

pass

return
WebSocketDaemon
(
Expand Down Expand Up @@ -5169,25 +5186,10 @@
logging
)

try
:

StructuredLogger
.
_lock
.
release
release_mozlog_lock
(
)

except
threading
.
ThreadError
:

pass

return
WebSocketDaemon
(
Expand Down

0 comments on commit b370f60

Please sign in to comment.