circleci

rm -rf /home/circleci/.gitconfig
borkdude 2019-09-04T11:25:37.001100Z

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

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

Marc O'Morain 2019-09-04T11:27:09.001800Z

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

Marc O'Morain 2019-09-04T11:27:12.002Z

any error message?

borkdude 2019-09-04T11:27:22.002300Z

it just waits

borkdude 2019-09-04T11:27:55.002800Z

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

borkdude 2019-09-04T11:31:37.003200Z

I can also just use Python:

python -m SimpleHTTPServer 7777

borkdude 2019-09-04T11:31:42.003400Z

that does seem to work

borkdude 2019-09-04T11:34:34.004200Z

weird:

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

circleci@f55c318fd0a9:~$ nc -z localhost 7777
circleci@f55c318fd0a9:~$ echo $?
0

Marc O'Morain 2019-09-04T12:04:42.004400Z

that’s weird. I have no idea.