bashunit
bashunit copied to clipboard
Alpine errors when running tests in parallel
| Q | A |
|---|---|
| OS | Linux (Alpine) |
| Shell | bash 3.2 |
| bashunit version | 0.17 |
Summary
Recently, I added parallel testing in bashunit https://github.com/TypedDevs/bashunit/pull/358 It works pretty well on macOS, however on linux alpine I get these errors (race conditions, I assume) and I after spending hours on it, I was not able to solve it, so I added this note to be aware of it.
Current behavior
Parallel tests are not working properly on linux alpine.
There is currently a feature flag for the parallel feature. See: parallel::is_enabled
function parallel::is_enabled() {
if env::is_parallel_run_enabled && (check_os::is_macos || check_os::is_ubuntu); then
return 0
fi
return 1
}
Which means, parallel is enabled when the env flag is true BASHUNIT_PARALLEL_RUN=true and is macos or ubuntu.
How to reproduce
You can install and run a docker instance with the bare minimum to run bashunit in your machine using docker:
# from the project itself, using Makefile
make docker/alpine
# then once it's loaded you can run bashunit
./bashunit --simple --parallel
Expected behavior
Parallel tests should work on linux alpine.
Maybe you @skinner-m-c can have some idea why is this error occurring in Alpine but not in macOS 🤔 I thought about mentioning you because you opened https://github.com/TypedDevs/bashunit/issues/329 and you might have more experience than me with alpine. I've spend hours on this error but I couldn't find a way to deal with it. It's not a blocker anyway, as the feature is working fine in other OS and it's also not interfering with the normal/sync flow.