zuiluoyin commented on a change in pull request #3730: [ZEPPELIN-4743] fix
MongoNotebookRepo get unstable note path
URL: https://github.com/apache/zeppelin/pull/3730#discussion_r407415851
##########
File path:
zeppelin-plugins/notebookrepo/mongo/src/test/java/org/apache/zeppelin/notebook/repo/MongoNotebookRepoTest.java
##########
@@ -49,7 +49,9 @@
@Before
public void setUp() throws IOException {
String bindIp = "localhost";
- int port = new ServerSocket(0).getLocalPort();
+ ServerSocket socket = new ServerSocket(0);
+ int port = socket.getLocalPort();
+ socket.close();
Review comment:
I think socket should be closed before the free port is used, otherwise
mongodb will not start because the port is occupied.
Please correct me if I say anything wrong. Thanks @zjffdu
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services