wokwi / wokwi-features

Wokwi Feature requests & Bug Reports
https://wokwi.com
72 stars 17 forks source link

Simulation not starting #793

Closed lucasssvaz closed 2 months ago

lucasssvaz commented 4 months ago

Describe the bug Sometimes the simulation apparently won't start. (Maybe it is taking way too long to start but it times out before that)

To Reproduce No specific steps, sometimes the Wokwi CLI won't start the simulation after being called by pytest:

 =========================== short test summary info ============================
FAILED tests/validation/democfg/test_democfg.py::test_cfg - pexpect.exceptions.TIMEOUT: Not found "Hello cfg!"
Bytes in current buffer (color code eliminated): Wokwi CLI v0.9.1 (cfd2078ca922) Connected to Wokwi Simulation API 1.0.0-20240518-gdbbf1224
Please check the full log here: /tmp/pytest-embedded/2024-05-19_02-19-10-065724/test_cfg/dut.log
====================== 1 failed, 14 deselected in 30.18s =======================

Expected behavior No hanging or big delay before starting the simulation.

Environment (please complete the following information):

Additional context Some places where this happened:

https://github.com/espressif/arduino-esp32/actions/runs/9144334087/job/25142139131 https://github.com/lucasssvaz/arduino-esp32/actions/runs/9240086259/job/25420033517 https://github.com/lucasssvaz/arduino-esp32/actions/runs/9240024519/job/25419849482 https://github.com/lucasssvaz/arduino-esp32/actions/runs/9236780292/job/25413060095 https://github.com/lucasssvaz/arduino-esp32/actions/runs/9236847049/job/25413184000

urish commented 4 months ago

Hi Lucas, thanks for reporting!

I've just launched a new experimental action that runs the CI Server next to the wokwi-cli, inside the GitHub runner itself (using docker).

To use it, simply add the following lines to your workflow, anywhere before using the wokwi-cli:

      - name: Wokwi CI Server
        uses: wokwi/wokwi-ci-server-action@v1

Can you please test it and report if you are observing an improvement?

lucasssvaz commented 4 months ago

Looks promising. For now it looks like it solved this issue and the API errors. Will perform more testing though

lucasssvaz commented 4 months ago

This will be added to https://github.com/espressif/arduino-esp32/pull/9696 Let's see how it behaves

urish commented 4 months ago

Thanks for testing! Good to see the API errors disappeared.

Seems like the new issue is only happening with the WiFi test on the ESP32?

Can you please add the following to the action yaml, right after running the actual test?

      - name: CI Server Logs
        if: always()
        run: |
          docker logs -t $(docker ps -q)

This should let us see if the CI server is reporting anything suspicious when the failures happen.

lucasssvaz commented 4 months ago

@urish Just ignore my previous message 😆 I forgot that it will only run the updates once it is merged to master.

In my fork it is working all good for now

lucasssvaz commented 4 months ago

Idk what happened but the server docker container started failing in all tests sometimes:

image

https://github.com/lucasssvaz/arduino-esp32/actions/runs/9259955226/job/25472955911?pr=14

urish commented 4 months ago

Are you running inside a GitHub hosted runner or self-hosted runner?

urish commented 4 months ago

Nevermind the question - the issue is that you are running the wokwi-ci-server-action twice.

lucasssvaz commented 4 months ago

Oops, my bad. I merged the changes from upstream but didn't see that duplication. Sorry about that