fossasia / visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Apache License 2.0
9.99k stars 1.14k forks source link

More consistent env-select test with polling enabled #920

Closed da-h closed 1 year ago

da-h commented 1 year ago

Description

This PR fixes the failing test "env selection works" (in ./cypress/integration/basic.js) for the polling-option of visdom (i.e. using the argument -use_frontend_client_polling).

Reason for the error was simply that upon initialization of the client (i.e. when opening http://localhost:8097), two calls to query the initial env main are implicitly sent. The failed test then proceeded to check if un-selecting and re-selecting the env works correctly. The error appeared because the polling variant which is slower than the websocket variant, has responded with the second of the two initial queries when the test already cleared the selection box and thus expected the selection to be empty.

Note that the error appears only if the polling is too slow in its initial setup, thus, the error had appeared only somewhat randomly.

This can be easily solved, by letting the test wait until the page loaded correctly (~1sec).

Motivation and Context

See #917 and #918, where the error appeared.

How Has This Been Tested?

10-fold consistency using github actions.

Screenshots (if appropriate):

Types of changes

Checklist:

JackUrb commented 1 year ago

These bugs can be tricky to find, thanks for the discovery and solve!