zauberzeug / nicegui

Create web-based user interfaces with Python. The nice way.
https://nicegui.io
MIT License
9.77k stars 580 forks source link

chromium uses 100% cpu in dev container and tests timeout #3781

Open valankar opened 3 weeks ago

valankar commented 3 weeks ago

Description

I'm trying out the dev container and just running a test (e.g. test_tabs.py). From what I can tell, the chromium process just go to 100% cpu, and after some minutes the test times out.

top output during test run:

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 750002 valankar  20   0 1156.2g  79100  62088 R 100.0   1.0   3:52.08 chromium
 749803 valankar  20   0   32.6g 176452 149428 S   9.3   2.2   0:21.49 chromium
 750067 valankar  20   0   32.6g  46400  31736 S   9.3   0.6   0:20.86 chromium

Any idea what is wrong here or how to debug?

valankar commented 3 weeks ago

What vscode looks like during test run:

image

valankar commented 3 weeks ago

And after the timeout:

image

rodja commented 3 weeks ago

This may be a duplicate of https://github.com/zauberzeug/nicegui/issues/3066. Can you check?

valankar commented 3 weeks ago

That looks like something else. In my case it is chromium using up cpu, not a nicegui app. Basically, I'm trying to setup the devcontainer environment to make changes to nicegui code. But when I try any of the nicegui tests they just fail as above.

rodja commented 3 weeks ago

That it strange. Can anyone else reproduce this error? On Mac the dev container seems to run the tests without any cpu spikes: devcontainer-test

valankar commented 2 weeks ago

FWIW I'm running Windows 11. I tried both using a WSL2 remote container on local Debian (WSL), as well as a remote SSH on a Debian server. Both result in chromium using 100% cpu and timing out the test. Are you using Debian for the container or something else? I can't tell from the screenshot. Also your process listing shows chrome, whereas mine shows chromium. Not sure if that is relevant.

valankar commented 2 weeks ago

I just tried with container on Ubuntu-24.04 WSL2. Similarly fails, and also shows chromium vs chrome.

rodja commented 2 weeks ago

Are you using Debian for the container or something else?

I have started our devcontainer specified in https://github.com/zauberzeug/nicegui/blob/main/.devcontainer/devcontainer.json which is Debian based. Are you not using this configuration?

valankar commented 2 weeks ago

Yes. I'm referring to the docker host, i.e. the host that creates and runs the devcontainer. At least on Windows, there are a couple of possibilities:

  1. Docker daemon running on a distribution in WSL2
  2. Docker daemon running on a remote machine via SSH
  3. Docker daemon running on Docker Desktop with WSL2
  4. Docker daemon running on Docker Desktop with Hyper-V

Some of these can be a specific Linux distribution. But it really should not matter, I'm just curious. It sounds like on Mac it is just the docker daemon on Mac.

Is there any Windows developer of NiceGUI that can confirm it works (i.e. not a Mac user)?

I will try to create a video showing the issue.

valankar commented 2 weeks ago

Here is a video showing what I did:

https://youtu.be/rG2LzK5Qf1A?si=YDSZs8ftGLT4kd_C

In this one I'm just using Docker Desktop with WSL2. I cancelled the tests after 10 minutes. The chromium process stays running at 100% cpu and needs to be killed.