|
1 | 1 | # Copyright (c) 2020-2022 The MathWorks, Inc. |
2 | 2 |
|
3 | | -import aiohttp |
4 | 3 | import asyncio |
5 | 4 | import errno |
6 | 5 | import json |
7 | 6 | import logging |
8 | 7 | import os |
9 | | -import time |
10 | 8 | import socket |
11 | 9 | import sys |
12 | | - |
| 10 | +import time |
13 | 11 | from collections import deque |
14 | 12 | from datetime import datetime, timedelta, timezone |
15 | 13 |
|
| 14 | +import aiohttp |
| 15 | + |
16 | 16 | from matlab_proxy import util |
17 | | -from matlab_proxy.util.mwi import token_auth |
18 | | -from matlab_proxy.util import mw, mwi, windows, system |
| 17 | +from matlab_proxy.util import mw, mwi, system, windows |
19 | 18 | from matlab_proxy.util.mwi import environment_variables as mwi_env |
| 19 | +from matlab_proxy.util.mwi import token_auth |
20 | 20 | from matlab_proxy.util.mwi.exceptions import ( |
21 | 21 | EmbeddedConnectorError, |
22 | 22 | EntitlementError, |
23 | 23 | InternalError, |
24 | 24 | LicensingError, |
25 | 25 | MatlabError, |
26 | | - XvfbError, |
27 | 26 | MatlabInstallError, |
28 | 27 | OnlineLicensingError, |
| 28 | + XvfbError, |
29 | 29 | log_error, |
30 | 30 | ) |
31 | 31 |
|
@@ -475,13 +475,10 @@ def prepare_lock_files_for_MATLAB_launch(self): |
475 | 475 | ) |
476 | 476 | return |
477 | 477 |
|
478 | | - # When testing in github workflows, for windows container's, PermissionError is |
| 478 | + # For windows container's (when testing in github workflows) PermissionError and in linux, OSError is |
479 | 479 | # thrown when trying to bind a used port from a previous test instead of the expected socket.error |
480 | 480 | except (OSError, PermissionError) as e: |
481 | | - if system.is_windows(): |
482 | | - pass |
483 | | - else: |
484 | | - raise e |
| 481 | + pass |
485 | 482 |
|
486 | 483 | except socket.error as e: |
487 | 484 | if e.errno != errno.EADDRINUSE: |
@@ -788,7 +785,7 @@ async def matlab_stderr_reader(): |
788 | 785 |
|
789 | 786 | # The maximum amount of time in seconds the Embedded Connector can take |
790 | 787 | # for lauching, before the matlab-proxy server concludes that something is wrong. |
791 | | - self.embedded_connector_max_starting_duration = 15 |
| 788 | + self.embedded_connector_max_starting_duration = 120 |
792 | 789 |
|
793 | 790 | # In Windows systems, errors are raised as UI windows and cannot be captured programmatically. |
794 | 791 | # So, check for how long the Embedded Connector is not up and then raise a generic error. |
|
0 commit comments