Closed mfacar closed 4 months ago
We have reviewed the mentioned PR and we are not 100% sure that the PR is responsible for the flakiness. Maybe the update of Node version (which happened at the same time) could be actually responsible for this? This is an ES issue and the PR adding the -force flag apparently is not affecting the ES flow.
@mfacar @Zasa-san @konzz further inspection reveals that the e2e flakiness is actually coming from that same step for loading the fixtures
CypressError:
cy.exec('yarn blank-state --force')failed because the command exited with a non-zero code.
That is, the breforeAll that loads fixtures:
1) "before all" hook for "should have no detectable accessibility violations on load"
So all the problem is coming from the same source. On the bright side, our e2e seem to be robust.
@mfacar I kept testing out things and it seems that this is happening due to slowness in elasticsearch in the CI environment. That socked hang up problems indicates either the client or the server closing the connection, probably the client due to a timeout while waiting for a server response.
How to increase the timeout seems to be quite a topic when using isomorphic-fetch (depending on node-fetch). Also, this library hasn't been updated in 4 years and it seems like other options are taking the space like cross-fetch, node-fetch or even undici (I also reported an issue related to node-fetch performance here: https://github.com/huridocs/uwazi/issues/4589).
Upgrading these libraries may fix the problem since they are internally handling timeouts in a different way. I think it may be worth it.
After a quick discussion with @mfacar we should consider Axios as a potential replacement for node-fetch.
After #6416, different workflows started to fail with code 1 in the step "Run yarn blank-state".
Output error:
Cypress e2e Jobs for reference: First occurrence Recent occurrence