Tester with Kdyby\TesterExtras sometimes fails (for no obvious reason)

Notice: This thread is very old.
Honza Kuchař
Member | 1662
+
0
-

Hi!

From time to time, when I run Nette\Tester on our CI server, Nette\Tester fails with strange error.

 _____ ___  ___ _____ ___  ___
|_   _/ __)( __/_   _/ __)| _ )
  |_| \___ /___) |_| \___ |_|_\  v1.4.0

PHP binary:
/usr/bin/php5-cgi

PHP version:
5.5.9-1ubuntu4.7 (cgi-fcgi)

Loaded php.ini files:
/home/gitlab-runner/tmp/builds/project-3/tests/GrifartTests/php-unix.ini

Loaded extensions:
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, date, dba, dom, ereg, exif, fileinfo, filter, ftp, gettext, hash, iconv, json, libxml, mbstring, mhash, openssl, pcntl, pcre, Phar, posix, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, zip, zlib

OK (50 tests, 4.1 seconds)
 _____ ___  ___ _____ ___  ___
|_   _/ __)( __/_   _/ __)| _ )
  |_| \___ /___) |_| \___ |_|_\  v1.4.0

PHP 5.5.9-1ubuntu4.7 | php-cgi -c '/home/gitlab-runner/tmp/builds/project-3/tests/GrifartTests/php-unix.ini' | 8 threads

..........................F.......................

-- FAILED: This file is part of ExtJS Remoting API. | RemotingApi/EntryPointList/EntryPointListTest.phpt [method=test_getEntryPoint_ok]
   Exited with error code 255 (expected 0)
   UnexpectedValueException: RecursiveDirectoryIterator::__construct(/home/gitlab-runner/tmp/builds/project-3/tests/GrifartTests/tmp/c18a64d3682056db21bc4c5848a42153/_Nette.RobotLoader): failed to open dir: No such file or directory

   in src/Finder/RecursiveCallbackFilterIterator.php(36)
   in [internal function]RecursiveDirectoryIterator->__construct()
   in src/Finder/RecursiveCallbackFilterIterator.php(36) RecursiveDirectoryIterator->getChildren()
   in [internal function]Nette\Utils\RecursiveCallbackFilterIterator->getChildren()
   in src/RobotLoader/RobotLoader.php(171) FilterIterator->next()
   in [internal function]Nette\Loaders\RobotLoader->rebuildCallback()
   in src/Caching/Cache.php(102) call_user_func_array()
   in [internal function]Nette\Caching\Cache->Nette\Caching\{closure}()
   in src/Caching/Cache.php(133) call_user_func_array()
   in src/Caching/Cache.php(103) Nette\Caching\Cache->save()
   in src/RobotLoader/RobotLoader.php(67) Nette\Caching\Cache->load()
   in tester-extras/src/Bootstrap.php(67) Nette\Loaders\RobotLoader->register()
   in tests/GrifartTests/bootstrap.php(17) Kdyby\TesterExtras\Bootstrap::createRobotLoader()
   in RemotingApi/EntryPointList/EntryPointListTest.phpt(19) require()


FAILURES! (50 tests, 1 failure, 4.0 seconds)

When you run test one more, everything works as expected. Do you have any idea what went wrong? Thanks!

Milo
Nette Core | 1283
+
0
-

@HonzaKuchař Race conditions https://github.com/…ootstrap.php#L36

Honza Kuchař
Member | 1662
+
0
-

So can I call it Kdyby\TesterExtras bug? @FilipProcházka Maybe there should be some locking…

Honza Kuchař
Member | 1662
+
0
-

But isn't there TEMP_DIR separate for each test? https://github.com/…ootstrap.php#L35 I've checked it on my evironment – every test has separate temp folder → should not cause problems, but it does?! issue: https://github.com/…ras/issues/2

Honza Kuchař
Member | 1662
+
0
-

Folow up: “Solved” by not using RobotLoader → switched to composer classmap.