Why can containers improve test reproducibility, and what isolation do they not provide by default?
Answer
Containers package an application and dependencies while sharing the host kernel, making environments portable and fast to start. Virtual machines include a guest OS and stronger boundary. Neither removes external-data, network or configuration drift automatically.
Strong answer includes
- shared kernel versus guest OS
- reproducible dependencies
- recognizes remaining drift
Practical example
A test suite runs reliably in a Docker container locally and in CI because the exact library versions are baked into the image, but it still occasionally fails because it depends on an external staging API whose data changes daily — proving that containerizing dependencies doesn't containerize external state.