Resto/CI: use a fresh port in [chunked_output] and fail faster in the CI
What
- Uses a fresh port instead of a hardcoded one in Resto's chunked output integration tests.
- Sets the timeout to 10 min (from 60 min) for the
resto.unit-<arch>jobs.
Why
To reduce flakiness of resto.unit:x86_64. E.g. 4 failures yesterday:
- https://gitlab.com/tezos/tezos/-/jobs/10365618526
- https://gitlab.com/tezos/tezos/-/jobs/10362069363
- https://gitlab.com/tezos/tezos/-/jobs/10361787097
- https://gitlab.com/tezos/tezos/-/jobs/10358455780
All raising a Unix.EADDRINUSE error (address already in use).
Timeout is lowered as
- this job should be quick (< 1 min in my observations)
- failing fast is better.
How
- We use a fresh port instead of a hardcoded one. (We reuse a Tezt function.)
- We also set the socket with the
SO_REUSEADDRto be able to reuse a port that is inTIME_WAITafter the socket is closed.
NB: this is a quick fix to avoid pipeline failures. Not all flakiness is eliminated (cf. test results below) but this MR seems to improve the situation. A better but more time-consuming solution could be to port these tests to Tezt.
Manually testing the MR
-
make -C ci checkfor the timeout changes -
For testing the flakiness reduction, we launched test pipelines running 100
resto.unit:x86_64jobs in parallel.- before our changes: 6/100 failures https://gitlab.com/tezos/tezos/-/pipelines/1864397885/failures (https://gitlab.com/tezos/tezos/-/blob/11df83b69144e9661118c09be43358ae682fe1d1/resto/test/chunked_output_integration_test.ml#L158)
- fresh port: 3/100 failures https://gitlab.com/tezos/tezos/-/pipelines/1872212237/failures
- fresh port + quick reuse: 1/100 failure https://gitlab.com/tezos/tezos/-/pipelines/1873619884/failures
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Bruno B