The WebGL example shows a very weird behavior, which was discovered by #676 .
The relevant test in the PR is this:
|
@pytest.mark.xfail(reason="it never finishes loading, issue #678") |
|
def test_webgl_raycaster_index(self): |
|
# XXX improve this test |
|
self.goto("examples/webgl/raycaster/index.html") |
|
self.wait_for_pyscript() |
|
assert self.page.title() == "Raycaster" |
|
wait_for_render(self.page, "*", "<canvas.*?>") |
The pytest log is the following (some lines deleted for better readability):
[ 0.00 page.goto ] examples/webgl/raycaster/index.html
[ 0.01 http_server ] "GET /examples/webgl/raycaster/index.html HTTP/1.1" 200 -
[ 0.02 http_server ] "GET /examples/webgl/raycaster/style.css HTTP/1.1" 200 -
[ 0.02 http_server ] "GET /build/pyscript.css HTTP/1.1" 200 -
[ 0.02 http_server ] "GET /build/pyscript.js HTTP/1.1" 200 -
...cut...
[ 0.28 console.log ] RUNTIME READY
[ 0.28 console.log ] config set!
[ 0.28 console.log ] initializers set
[ 0.28 console.log ] post initializers set
[ 0.28 console.log ] post initializers set
[ 0.28 console.log ] post initializers set
[ 0.28 console.log ] connected
[ 0.28 console.log ] config set!
[ 0.28 console.log ] config set {autoclose_loader: true, runtimes: Array(1)}
[ 0.28 console.log ] Initializing runtimes...
[ 0.28 console.error ] Failed to load resource: net::ERR_CONNECTION_REFUSED
[ 0.38 console.log ] creating pyodide runtime
[ 2.82 console.log ] Python initialization complete
[ 2.82 console.log ] loading micropip
[ 2.82 console.log ] Loading micropip, pyparsing, packaging, distutils
[ 3.15 console.log ] Loaded micropip, pyparsing, packaging, distutils
[ 3.15 console.log ] loading pyscript...
[ 3.88 console.log ] done setting up environment
[ 3.88 console.log ] RUNTIME READY
[ 3.88 console.log ] Collecting nodes to be mounted into python namespace...
[ 3.88 console.log ] evaluate
[ 3.89 console.log ] ----> changed out to py-bd3390f1-3834-cbd7-da68-0caf534ffb9a true
[ 3.89 console.log ] ----> changed out to py-bd3390f1-3834-cbd7-da68-0caf534ffb9a true
[ 3.96 console.log ] THREE.WebGLRenderer 89
[ 4.39 console.warning] [.WebGL-0xc400345b00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[ 4.44 console.warning] [.WebGL-0xc400345b00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[ 4.49 console.warning] [.WebGL-0xc400345b00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels
[ 4.53 console.warning] [.WebGL-0xc400345b00]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels (this message will no longer repeat)
After that, it never reaches this point, and thus it never prints ===PyScript page fully initialized===:
|
for (const initializer of postInitializers_) { |
|
await initializer(); |
|
} |
|
console.log('===PyScript page fully initialized==='); |
I suspect it's because of the while True: loop in the <py-script>, but we should probably sit down and decide whether it's the behavior that we want.
Moreover, another weird thing is that if I run the example manually, the loader screen correctly hides, but if I run it with playwright inside the tests, the loader stays forever.
The WebGL example shows a very weird behavior, which was discovered by #676 .
The relevant test in the PR is this:
pyscript/pyscriptjs/tests/test_zz_examples.py
Lines 200 to 206 in b90813b
The pytest log is the following (some lines deleted for better readability):
After that, it never reaches this point, and thus it never prints
===PyScript page fully initialized===:pyscript/pyscriptjs/src/components/pyconfig.ts
Lines 119 to 122 in b90813b
I suspect it's because of the
while True:loop in the<py-script>, but we should probably sit down and decide whether it's the behavior that we want.Moreover, another weird thing is that if I run the example manually, the loader screen correctly hides, but if I run it with
playwrightinside the tests, the loader stays forever.