Open kevindew opened 2 years ago
I've implemented a workaround for the Whitehall and Content Publisher apps in #539, which follows an approach laid out in a comment on docker/for-linux#1015.
In short: it turns out the bug doesn't occur when /tmp
is mounted as a tmpfs
volume.
People have experienced problems running the test suites of Content Publisher and Whitehall (I'm not aware of other apps but there could be more) using govuk-docker. It transpires this issue is a problem with the Linux kernel, in particular the version that Docker-for-mac is using currently (on my machine it's
5.10.47-linuxkit
) but I'm recording this here so the GOV.UK issue is documented and can be tracked to a degree.The evidence of the problem is tests that fail like so:
or
The source of the issue is a relatively obscure set of circumstances: a file is stored on a docker mount (i.e. a test fixture), it is then copied to be a temporary file (i.e. a test faking the upload of a file) and then is copied again (i.e copying the uploaded file for processing).
The issue is discussed (at length) in: https://github.com/docker/for-linux/issues/1015. It looks like versions of Linux Kernel > 5.10 are fixed and it appears that a backported fix for 5.10 is imminent, however it's completely unclear how long it will take for any fixes to make their way into a Docker-for-mac releases.
The two options I see ahead of us for this are:
1) Wait it out, expect that a future release of Docker Desktop for mac resolves it 2) Refactor test code that is affected by this issue to no longer be affected by the circumstances - there seems to be some examples based off the issue
By default, we're effectively doing 1) now - I imagine if this issue continues for multiple months we may switch to taking 2)