Comments (9)
Over here, (Ubuntu 18.04, erlang solutions erlang and elixir) creating a fresh project with mix new
and with version 1.0.1 of this package added to deps does not show test output at all
$ mix test.watch
Running tests...
Running tests...
Running tests...
Running tests...
^C
(here i changed the generated test a couple of times until I gave up)
Switching back to version 0.9 however yields test output just as it used to be.
Furthermore, I can confirm that when using version 1.0.1, I can get it to work when I manually edit the zombie_killer script to use bash instead of sh (as @grantwest and @vheathen also pointed out)
from mix-test.watch.
Thanks for the excellent feedback everyone!
What do we think about using bash instead of sh? Seeing as this is a dev tool I think that would be reasonable.
from mix-test.watch.
@grantwest I think you're probably not seeing any more output beyond that point because of
mix-test.watch/priv/zombie_killer
Lines 7 to 8 in cabcb68
If you uncomment that line and run it with set -x
, what do you see?
I think that different versions of kill
might take different flags sometimes, e.g. kill -KILL
vs. kill -SIGKILL
, so it could be that we need to use the signal number (kill -9
) instead in order to be more OS-/distro-agnostic. What happens if you replace the two kill -KILL
s with kill -9
?
from mix-test.watch.
Commenting out the exec >/dev/null 2>&1
yields this:
Running tests...
+ pid1=23943
+ pid2=23944
+ shwait MIX_ENV=test mix do run -e 'Application.put_env(:elixir, :ansi_enabled, true);', test
23943
+ read
/src/_build/dev/lib/mix_test_watch/priv/zombie_killer: 14: read: arg count
+ kill -KILL 23943
+ ret=137
+ kill -KILL 23944
+ exit 137
Looks like the sh
version of read
doesn't like to be called without args. I can change it to be read UNUSED;
and then I get this:
Running tests...
+ pid1=26902
+ exec sh -c MIX_ENV=test mix do run -e 'Application.put_env(:elixir, :ansi_enabled, true);', test
+ pid2=26903
+ wait 26902
+ read UNUSED
+ kill -KILL 26902
+ ret=137
+ kill -KILL 26903
+ exit 137
The tests still aren't running though. I think it has something to do with the quoting of the args to the exec sh -c
command.
from mix-test.watch.
Doesn't work for me either. It works if I change the zombie killer script shell to bash.
from mix-test.watch.
Why do we not use the script recommended by the standard library? https://hexdocs.pm/elixir/Port.html#module-zombie-operating-system-processes
from mix-test.watch.
I initially tried adding that script in #106, but it didn't work for me. The version that I ended up adding here is the one that's in the Port
module documentation in the master
Elixir branch (I'm not sure why it's not in the most recent Elixir release), which was the culmination of this issue (elixir-lang/elixir#9171).
Since this is just a copy of the script that exists in the Elixir lang repo, perhaps it would make more sense to open an issue and ask for help there? If we can make it more portable, we'd probably want that change to be made in the Port
documentation also, either way?
from mix-test.watch.
Perhaps a wider discussion would be beneficial. If this script does work for everyone I may revert to not using it until it is ready.
from mix-test.watch.
That makes sense @lpil. Sorry for the issues, everyone!
@grantwest, would you like to open an issue in elixir-lang/elixir
to follow up on this? I'd also be happy to!
from mix-test.watch.
Related Issues (20)
- Running with `mix cmd` leaves a zombie process HOT 1
- Feature: Loop on failed HOT 1
- --stale option doesn't work on Elixir v1.7.* HOT 7
- `test.watch` for one test file runs all tests instead HOT 5
- zombie_killer script not shipping with package HOT 1
- test.watch so slow and hangs sometime HOT 8
- Database couldn't be dropped HOT 10
- Interactive watch mode HOT 2
- test watch terminating on MacOSX 11.1 HOT 7
- Warning when configuring `:mix_test_watch` in Umbrella project
- ** (Mix) The task "test.watch" could not be found HOT 4
- Automatically run deps.get when missing dep HOT 1
- Prevent execution of commands of mix :dev environment HOT 4
- ** (Postgrex.Error) ERROR 40P01 (deadlock_detected) deadlock detected HOT 2
- Config.env() is deprecated HOT 1
- Missing file completion on macOS zsh HOT 2
- Passing cli_args HOT 1
- Clear screen and scroll history
- Support running in custom mix envs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mix-test.watch.