klassen-software-solutions / kssio

C++ I/O library (networking, files, and streams)
MIT License
0 stars 0 forks source link

unit test of poller is failing intermittently #14

Closed stevenklassen8376 closed 5 years ago

stevenklassen8376 commented 5 years ago

Seems to occur more on Linux than macOs, but I've seen it on the mac as well.

steve@parallels-vm:/media/psf/Home/Documents/Sources/kss/Libraries/kssio$ make check
LD_LIBRARY_PATH=".build/Linux-x86_64/lib" .build/Linux-x86_64/tests/unittest
Running test suites for KSSIO...
  ...........F.
  Passed 12 of 13 test suites, 1 failed.
  Failures:
    poller.cpp: 139, d.numRead() == static_cast<ssize_t>(mydata.size() * 5)
  Completed in 0.022468s.
BuildSystem/common.mk:182: recipe for target 'check' failed
make: *** [check] Error 1
stevenklassen8376 commented 5 years ago

Looks like it was just a problem with the unit test. It was necessary to ensure that the test file was done writing and that the file position was set back to the beginning, before we start the poller. Otherwise, if the poller read to the end of the file (e.g. before the writes were done), it would report an "eof" and remove the resource, hence not complete the reading.