mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 00:25:04 +00:00
AsyncTask: Fix retrieval of null data from the thread-local storage (#6176)
This commit is contained in:
@ -121,4 +121,23 @@ class AsyncPoolTest extends TestCase{
|
||||
usleep(50 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
public function testNullComplexDataFetch() : void{
|
||||
$this->pool->submitTask(new class extends AsyncTask{
|
||||
public function __construct(){
|
||||
$this->storeLocal("null", null);
|
||||
}
|
||||
|
||||
public function onRun() : void{
|
||||
//dummy
|
||||
}
|
||||
|
||||
public function onCompletion() : void{
|
||||
AsyncPoolTest::assertNull($this->fetchLocal("null"));
|
||||
}
|
||||
});
|
||||
while($this->pool->collectTasks()){
|
||||
usleep(50 * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user