smartcat-labs / cassandra-diagnostics

Cassandra Node Diagnostics Tools
Apache License 2.0
51 stars 6 forks source link

Improve unit tests for DataDog reporter #221

Closed nivancevic closed 7 years ago

nivancevic commented 7 years ago

Test UDP server causes BindException (Address already in use) in unit tests for datadog reporter. Test UDP server could be started @BeforeClass and stopped @AfterClass. Also, it could be moved to integration tests.

nbozic-zz commented 7 years ago

Address already in use is just a symptom, not real problem (one test method fails, UDP server stays hanging and next test has bind address problem.

Still this is scary test, and it is testing more than it should do since we need to test client and not the server receiving messages. Test should be reworked to mock client sending messages and verify number of times message is sent.

nbozic-zz commented 7 years ago

Fixed issue with occasional failing of this test and documented improvement idea in #241