dinhlongviolin1 1 kuukausi sitten
vanhempi
säilyke
190422a414

+ 1 - 1
.github/workflows/overall-tests.yml

@@ -18,7 +18,7 @@ jobs:
     uses: ./.github/workflows/partial-tests.yml
 
   coverage:
-    timeout-minutes: 50
+    timeout-minutes: 60
     runs-on: ubuntu-latest
 
     if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.full_name == github.event.pull_request.head.repo.full_name

+ 2 - 1
taipy/gui/servers/fastapi/server.py

@@ -111,7 +111,7 @@ class FastAPIServer(_Server):
         self._port: t.Optional[int] = None
 
         # server setup
-        self._emit_queue: Queue[t.Tuple[t.Tuple[t.Any, ...], t.Dict[str, t.Any]]] = Queue()
+        self._emit_queue: t.Optional[Queue[t.Tuple[t.Tuple[t.Any, ...], t.Dict[str, t.Any]]]] = None
         self._server = server or FastAPI(json_encoder=_TaipyJsonEncoder)
         self._ws = socketio.AsyncServer(async_mode="asgi", cors_allowed_origins="*")
         self._server.mount("/socket.io", socketio.ASGIApp(self._ws, other_asgi_app=self._server, socketio_path="/"))
@@ -176,6 +176,7 @@ class FastAPIServer(_Server):
 
         @asynccontextmanager
         async def lifespan(app: FastAPI):
+            self._emit_queue = Queue()
             self._ws.start_background_task(emit_dispatcher)
             yield
 

+ 2 - 2
tests/gui/notebook/test_notebook_simple_gui.py

@@ -86,7 +86,7 @@ def test_notebook_simple_gui_fastapi(tb, helpers):
     tb.execute_cell("gui_stop")
     with pytest.raises(Exception) as exc_info:
         urlopen("http://127.0.0.1:5000/taipy-jsx/page1")
-    assert "Connection refused" in str(exc_info.value)
+    assert "refused" in str(exc_info.value)
     tb.execute_cell("gui_re_run")
     while True:
         with contextlib.suppress(Exception):
@@ -102,4 +102,4 @@ def test_notebook_simple_gui_fastapi(tb, helpers):
     tb.execute_cell("gui_re_stop")
     with pytest.raises(Exception) as exc_info:
         urlopen("http://127.0.0.1:5000/taipy-jsx/page1")
-    assert "Connection refused" in str(exc_info.value)
+    assert "refused" in str(exc_info.value)