1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 04:44:56 +01:00

Fix garbage and broken tests

This commit is contained in:
coderstephen 2015-08-28 14:41:27 -05:00
parent 8abb317507
commit 12023bd81e
4 changed files with 4 additions and 20 deletions

View File

@ -42,4 +42,4 @@ class InternalThreadedMutex extends \Threaded
{
$this->lock = true;
}
}
}

View File

@ -50,21 +50,4 @@ class ChannelTest extends TestCase
Loop\run();
}
/**
* @group threading
*/
public function testThreadTransfer()
{
list($a, $b) = Channel::createSocketPair();
$b = new Channel(new DuplexStream($b));
$thread = \Thread::from(function () {
$a = new Channel(new DuplexStream($this->a));
});
$thread->a = $a; // <-- Transfer channel $a to the thread
$thread->start();
$thread->join();
}
}

View File

@ -18,7 +18,7 @@ class ThreadedMutexTest extends TestCase
$lock = (yield $mutex->acquire());
$lock->release();
$this->assertTrue($lock->isReleased());
});
})->done();
Loop\run();
}

View File

@ -2,6 +2,7 @@
namespace Icicle\Tests\Concurrent\Threading;
use Icicle\Concurrent\Threading\LocalObject;
use Icicle\Promise\Promise;
use Icicle\Tests\Concurrent\TestCase;
/**
@ -84,7 +85,7 @@ class LocalObjectTest extends TestCase
public function testPromiseInThread()
{
$thread = \Thread::from(function () {
require __DIR__.'../../vendor/autoload.php';
require __DIR__.'/../../vendor/autoload.php';
$promise = new LocalObject(new Promise());
});