Closed nigelgbanks closed 3 years ago
It isn't a test time out issue, the issue stems from a service exiting before all services are started, and s6 overlay is overriding the exit code set by the exited service.
2021-04-13T08:16:25.0518935Z [36mbase_tests_serviceexitcode_base_1 |[0m [services.d] starting services
2021-04-13T08:16:25.0520158Z [36mbase_tests_serviceexitcode_base_1 |[0m [services.d] service test finish: executing...
2021-04-13T08:16:25.0522010Z [36mbase_tests_serviceexitcode_base_1 |[0m [services.d] service test exiting with exit code: 11Creating network "_base_tests_serviceexitcode_default" with the default driver
2021-04-13T08:16:25.0523340Z Creating base_tests_serviceexitcode_base_1 ...
2021-04-13T08:16:25.0524098Z Creating base_tests_serviceexitcode_base_1 ... done
2021-04-13T08:16:25.0524548Z
2021-04-13T08:16:25.0525326Z [36mbase_tests_serviceexitcode_base_1 |[0m [services.d] done.
Note that [services.d] done.
occurs after the service has exited. So it overrides the exit code here:
I can't reproduce this locally, though from the logs that is definitely what is happening according to the logs and from reading the code it makes sense, it's a really narrow margin.
Forcing it to run serially I cannot reproduce the problem locally either.
docker run --rm --cpus=1 --cpuset-cpus=0 test; echo $status 274ms Tue 13 Apr 2021 10:15:05 UTC
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] service test finish: executing...
[services.d] service test exiting with exit code: 11
[services.d] done.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
11
Though the services does exit now before init-stage2 exits.
I'm just gonna remove this test.
Bump up the default time out for tests to something larger than 30 seconds to prevent errors with GitHub actions.