Skip to content

The WebGL example never finishes loading #678

@antocuni

Description

@antocuni

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogissue has been triaged but has not been earmarked for any upcoming releaselang: typescriptRelated to the Typescript languagetype: bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions