Racing condition for mock response in iPython notebook renderer tests

In spec/javascripts/blob/notebook/index_spec.js axios requests are mocked but the tests don't wait for the mock response. This leads to a racing condition and the tests not being reliable.

You can see at least one test not using the mock response on CI:

  iPython notebook renderer
    ✔ shows loading icon
22 01 2018 17:18:30.300:WARN [web-server]: 404: /test

(https://gitlab.com/gitlab-org/gitlab-ce/-/jobs/49009523)

Also you can try yourself with

-      mock = new MockAdapter(axios);
+      mock = new MockAdapter(axios, { delayResponse: 10000 });

(which leads to failing tests)

Edited Jan 23, 2018 by Inactive Account
Assignee Loading
Time tracking Loading