From b370f6056cb4be221d2478d098b2b1bd980c3eda Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 3 Oct 2019 13:48:09 +0000 Subject: [PATCH] Bug 1492873 [wpt PR 13113] - Handle case where mozlog is not installed., 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 https://github.com/web-platform-tests/wpt/issues/13112. -- wpt-commits: 1f8fa9e610d934490538812d6121a77baf646bfc wpt-pr: 13113 UltraBlame original commit: ba995f8b27019322f6b01edc29c7d061145fba02 --- testing/web-platform/meta/MANIFEST.json | 2 +- .../web-platform/tests/tools/serve/serve.py | 78 ++++++++++--------- 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 4106512ed0bf0..4bfd7089629e5 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -4402298,7 +4402298,7 @@ py : [ " -e8c6af20857d210aef792f7d78aaddd3fdd8adcf +8f95bd492322a65a5bbb78430734b769730d9e35 " " support diff --git a/testing/web-platform/tests/tools/serve/serve.py b/testing/web-platform/tests/tools/serve/serve.py index ea428a74ac771..8f1462647c279 100644 --- a/testing/web-platform/tests/tools/serve/serve.py +++ b/testing/web-platform/tests/tools/serve/serve.py @@ -73,12 +73,6 @@ js_meta_re parse_variants from -mozlog -. -structuredlog -import -StructuredLogger -from wptserve import server @@ -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 @@ -5075,25 +5107,10 @@ logging ) -try -: - -StructuredLogger -. -_lock -. -release +release_mozlog_lock ( ) -except -threading -. -ThreadError -: - -pass - return WebSocketDaemon ( @@ -5169,25 +5186,10 @@ logging ) -try -: - -StructuredLogger -. -_lock -. -release +release_mozlog_lock ( ) -except -threading -. -ThreadError -: - -pass - return WebSocketDaemon (