Opened 2 months ago

Closed 7 weeks ago

#1515 closed defect (fixed)

tests fail during make unit-check

Reported by: bbell Owned by: bbell
Priority: major Milestone:
Component: rasmgr Version: development
Keywords: unit-check, unit, test Cc: dmisev
Complexity: Medium

Description

when using make unit-check, we observed that some tests are failing:

[bbell@localhost build]$ common/test/common_test 
[==========] Running 16 tests from 4 test cases.
[----------] Global test environment set-up.
[----------] 3 tests from TimerTest
[ RUN      ] TimerTest.CheckIfTimerIsNotExpiredWhenTimeHasNotPassed
[       OK ] TimerTest.CheckIfTimerIsNotExpiredWhenTimeHasNotPassed (0 ms)
[ RUN      ] TimerTest.SleepUntilTimerExpires
[       OK ] TimerTest.SleepUntilTimerExpires (300 ms)
[ RUN      ] TimerTest.SleepUntilTimerExpiresAndReset
[       OK ] TimerTest.SleepUntilTimerExpiresAndReset (301 ms)
[----------] 3 tests from TimerTest (601 ms total)

[----------] 8 tests from GrpcUtilsTest
[ RUN      ] GrpcUtilsTest.AddressToStringTest
[       OK ] GrpcUtilsTest.AddressToStringTest (0 ms)
[ RUN      ] GrpcUtilsTest.IsPortBusyHostNameTest
/home/bbell/projects/rasdaman/common/test/grpc/grpcutilstest.cc:48: Failure
Value of: GrpcUtils::isPortBusy(host, port)
  Actual: false
Expected: true
[  FAILED  ] GrpcUtilsTest.IsPortBusyHostNameTest (1 ms)
[ RUN      ] GrpcUtilsTest.IsPortFreeHostNameTest
[       OK ] GrpcUtilsTest.IsPortFreeHostNameTest (0 ms)
[ RUN      ] GrpcUtilsTest.IsPortFreeIpV4Test
[       OK ] GrpcUtilsTest.IsPortFreeIpV4Test (0 ms)
[ RUN      ] GrpcUtilsTest.IsPortFreeIpV6Test
[       OK ] GrpcUtilsTest.IsPortFreeIpV6Test (0 ms)
[ RUN      ] GrpcUtilsTest.IsPortBusyIpV4Test
/home/bbell/projects/rasdaman/common/test/grpc/grpcutilstest.cc:84: Failure
Value of: GrpcUtils::isPortBusy(host, port)
  Actual: false
Expected: true
[  FAILED  ] GrpcUtilsTest.IsPortBusyIpV4Test (1 ms)
[ RUN      ] GrpcUtilsTest.IsPortBusyIpV6Test
/home/bbell/projects/rasdaman/common/test/grpc/grpcutilstest.cc:93: Failure
Value of: GrpcUtils::isPortBusy(host, port)
  Actual: false
Expected: true
[  FAILED  ] GrpcUtilsTest.IsPortBusyIpV6Test (0 ms)
[ RUN      ] GrpcUtilsTest.IsPortBusyInvalidHostNameTest
[       OK ] GrpcUtilsTest.IsPortBusyInvalidHostNameTest (8 ms)
[----------] 8 tests from GrpcUtilsTest (11 ms total)

[----------] 3 tests from HealthServiceImplTest
[ RUN      ] HealthServiceImplTest.setStatus
[       OK ] HealthServiceImplTest.setStatus (0 ms)
[ RUN      ] HealthServiceImplTest.clearStatus
[       OK ] HealthServiceImplTest.clearStatus (0 ms)
[ RUN      ] HealthServiceImplTest.clearAll
[       OK ] HealthServiceImplTest.clearAll (0 ms)
[----------] 3 tests from HealthServiceImplTest (0 ms total)

[----------] 2 tests from HealthServiceServerTest
[ RUN      ] HealthServiceServerTest.serviceIsRunning
[       OK ] HealthServiceServerTest.serviceIsRunning (3 ms)
[ RUN      ] HealthServiceServerTest.serviceIsNotRunning
E0322 14:48:02.592801592   27858 tcp_client_posix.c:171]     failed to connect to 'ipv6:[::1]:9000': socket error: connection refused
E0322 14:48:02.593009222   27858 tcp_client_posix.c:171]     failed to connect to 'ipv4:127.0.0.1:9000': socket error: connection refused
[       OK ] HealthServiceServerTest.serviceIsNotRunning (103 ms)
[----------] 2 tests from HealthServiceServerTest (106 ms total)

[----------] Global test environment tear-down
[==========] 16 tests from 4 test cases ran. (718 ms total)
[  PASSED  ] 13 tests.
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] GrpcUtilsTest.IsPortBusyHostNameTest
[  FAILED  ] GrpcUtilsTest.IsPortBusyIpV4Test
[  FAILED  ] GrpcUtilsTest.IsPortBusyIpV6Test

 3 FAILED TESTS

and rasmgr_x's test throws

rasmgr_test: /usr/include/boost/smart_ptr/shared_ptr.hpp:653: typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = rasmgr::User; typename boost::detail::sp_member_access<T>::type = rasmgr::User*]: Assertion `px != 0' failed.
Aborted (core dumped)

Change History (2)

comment:1 Changed 2 months ago by bbell

Just a quick remark on the "isPortBusy*" unit-tests. They fail because we need to set up threads so that we can run a mock server, because 'isPortBusy' checks if a port is in use by trying to connect over that port, and if the connection succeeds, it flags the port as busy. It works using 7001 with rasdaman running; however, we should have a unit-test which does not rely on running the program to which the unit-test applies.

comment:2 Changed 7 weeks ago by bbell

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.