Django's LiveServerTestCase Always Fails Due to Conflicting Address… Despite Address Appearing Free

前端 未结 5 1074
心在旅途
心在旅途 2020-12-31 05:45

I\'m currently working on cleaning my Django functional tests to use the LiveServerTestCase rather than bouncing selenium based tests off an instance of the development envi

5条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 06:10

    This started happening to me when running subsequent tests after a previous one generated an internal server error. On a mac, use lsof to find the program using the port, and kill it. E.g.:

    $ sudo lsof -i :8081
    COMMAND    PID    USER   FD   TYPE            DEVICE SIZE/OFF NODE NAME
    firefox-b 1097 username    3u  IPv4 0x94495559c6dea35      0t0  TCP localhost:sunproxyadmin (LISTEN)
    
    $ kill -9 1097
    

提交回复
热议问题