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:
parent
8abb317507
commit
12023bd81e
@ -42,4 +42,4 @@ class InternalThreadedMutex extends \Threaded
|
||||
{
|
||||
$this->lock = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ class ThreadedMutexTest extends TestCase
|
||||
$lock = (yield $mutex->acquire());
|
||||
$lock->release();
|
||||
$this->assertTrue($lock->isReleased());
|
||||
});
|
||||
})->done();
|
||||
|
||||
Loop\run();
|
||||
}
|
||||
|
@ -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());
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user