Fork me on GitHub
#circleci
<
2019-09-04
>
borkdude11:09:37

@marc-omorain I'd like to do this on CircleCI for a unit test:

[email protected]:~$ nc -l 4444 &
[3] 486
[email protected]:~$ lsof -i:4444
[email protected]:~$
Any idea why there is no process listening on port 4444?

marc-omorain11:09:09

not immediately - what does nc -l 4444 do if you run it in the foreground?

marc-omorain11:09:12

any error message?

borkdude11:09:22

it just waits

borkdude11:09:55

the reason I'd like to do this is that I've made a function wait-for-it which does the same as the famous bash script

borkdude11:09:37

I can also just use Python:

python -m SimpleHTTPServer 7777

borkdude11:09:42

that does seem to work

borkdude11:09:34

weird:

[email protected]:~$ nc -l localhost 7777 &
[6] 515
[email protected]:~$ nc -z localhost 7777
[email protected]:~$ echo $?
1
vs
[email protected]:~$ python -m SimpleHTTPServer 7777 &
[7] 517
[email protected]:~$ Serving HTTP on 0.0.0.0 port 7777 ...

[email protected]:~$ nc -z localhost 7777
[email protected]:~$ echo $?
0

marc-omorain12:09:42

that’s weird. I have no idea.