Git Product home page Git Product logo

Comments (9)

rmoorman avatar rmoorman commented on June 2, 2024 2

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.

lpil avatar lpil commented on June 2, 2024 2

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.

rjdellecese avatar rjdellecese commented on June 2, 2024

@grantwest I think you're probably not seeing any more output beyond that point because of

# Silence warnings from here on
exec >/dev/null 2>&1

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 -KILLs with kill -9?

from mix-test.watch.

grantwest avatar grantwest commented on June 2, 2024

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.

vheathen avatar vheathen commented on June 2, 2024

Doesn't work for me either. It works if I change the zombie killer script shell to bash.

from mix-test.watch.

lpil avatar lpil commented on June 2, 2024

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.

rjdellecese avatar rjdellecese commented on June 2, 2024

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.

lpil avatar lpil commented on June 2, 2024

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.

rjdellecese avatar rjdellecese commented on June 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.