ocadotechnology / rapid-router

A Blockly and python based educational game aimed at students age 5-14.
https://www.codeforlife.education
Other
56 stars 62 forks source link

fix cow levels #1515

Closed faucomte97 closed 7 months ago

faucomte97 commented 8 months ago

Describe the bug Levels 38, 39 and 47 have cows in them. For some reason, adding the cows & cow blocks has caused the tests for these levels to fail. These tests fail locally for a while, after which they pass, this is flakiness incarnate. On the pipeline, they fail at every run.

To Reproduce Steps to reproduce the behaviour:

  1. Go to game/end_to_end_tests/test_play_through.py.
  2. Remove the pytest.mark.skip decorator for test_level_038, test_level_039 and test_level_047.
  3. Run pytest or pytest -n auto or run these tests individually.
  4. Notice how the browser gets stuck after loading the level solution and clicking the "Fast" button.
  5. Ignore the error message in the terminal, it isn't helpful.
  6. For better diagnosis, add a time.sleep after the Play button is clicked (game_page.py line 99, in run_program) - set it to 60 seconds so you have enough time to check things in the browser.
  7. Run the tests again, and while the code is sleeping open up the dev tools and check the console tab. The JS error there is a good place to start investigating.

Expected behaviour The tests should be able to load the solution, press play and complete the level like all the other cow-less levels.

Screenshots Private Zenhub Image

Desktop (please complete the following information): All machines, only tested on Chrome - might be worth checking other browsers. Happens only in the context of the tests, trying to replicate this manually when running the app won't work.

Additional context Selenium is super flaky.