Open lidel opened 1 year ago
I'll try to bump playwright libs and re-run while npm test; do :; done
see if it improves things or if the above problems still appear.
Seems that https://github.com/ipfs/ipfs-webui/pull/2066 stabilized test:e2e
run via playwright, but we still have flaky test:unit
tests:
[test:unit ] FAIL src/bundles/peer-bandwidth.test.js
[test:unit ] ● should get bandwidth for added peers
[test:unit ]
[test:unit ] expect(received).toBeTruthy()
[test:unit ]
[test:unit ] Received: undefined
[test:unit ]
[test:unit ] 201 | expect(bwPeers.length).toBe(peers.length)
[test:unit ] 202 |
[test:unit ] > 203 | bwPeers.forEach(({ bw }) => expect(bw).toBeTruthy())
[test:unit ] | ^
[test:unit ] 204 | })
[test:unit ] 205 |
[test:unit ] 206 | it('should periodically update bandwidth for peers', async () => {
[test:unit ]
[test:unit ] at forEach (src/bundles/peer-bandwidth.test.js:203:42)
[test:unit ] at Array.forEach (<anonymous>)
[test:unit ] at Object.<anonymous> (src/bundles/peer-bandwidth.test.js:203:11)
[test:unit ]
The underlying problem with unit tests is that they don't do smart await until specific data is available, they just sleep for a specified amount:
This is a tracking issue for removing flakiness of E2E tests, as this impacts other repos.
I've been running tests locally in a loop until they fail (
while npm test; do :; done
) and identified 4 types of failures.Pain points
(1)
(2)
(3)
4x more often than the rest
(4)