Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/catalog/test_hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,24 @@ def run(self) -> None:
client.write(self._response)
client.flush()
except Exception:
pass
break

@property
def port(self) -> int | None:
self._port_bound.wait()
return self._port

def close(self) -> None:
# Close all client connections first
try:
self._socket.close()
except Exception:
pass
self.join(timeout=5)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling I know the answer, but why 5?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just randomly picked a value, 5 seconds should be long enough for the threads to shutdown

for client in self._clients:
try:
client.close()
except Exception:
pass
self._socket.close()


@pytest.fixture(scope="session")
Expand Down
Loading