Plugins nicht mehr grundlos abschalten (0.48.1)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m59s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m54s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m42s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m9s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m6s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m51s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m32s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 57s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 6m59s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 6m54s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 7m42s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 7m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m9s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m6s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m51s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m32s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 57s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Absturz-Marken tragen ihren Zeitpunkt im Inhalt statt über filemtime(); ein einzelner Abbruch schaltet nicht mehr ab (zwei Abbrüche binnen 1 h). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d321e36637
commit
0e59748f03
5 changed files with 73 additions and 11 deletions
|
|
@ -232,15 +232,42 @@ class PluginSystemTest extends TestCase
|
|||
$this->makePlugin('absturz', base: 'core');
|
||||
$marker = storage_path('framework/plugins/booting-absturz');
|
||||
@mkdir(dirname($marker), 0777, true);
|
||||
file_put_contents($marker, '1');
|
||||
touch($marker, time() - 120);
|
||||
@unlink(storage_path('framework/plugins/strike-absturz'));
|
||||
|
||||
// Erster Abbruch: bleibt aktiv (kann von außen kommen, z. B. beendeter PHP-Prozess)
|
||||
file_put_contents($marker, (string) (time() - 120));
|
||||
$manager = $this->manager();
|
||||
$manager->registerAll();
|
||||
$this->assertTrue($manager->isEnabled('absturz'));
|
||||
$this->assertFileDoesNotExist($marker);
|
||||
|
||||
// Zweiter Abbruch binnen einer Stunde: abgeschaltet
|
||||
file_put_contents($marker, (string) (time() - 120));
|
||||
$manager = $this->manager();
|
||||
$manager->registerAll();
|
||||
$this->assertFalse($manager->isEnabled('absturz'));
|
||||
$this->assertStringContainsString('Schwerer Fehler', $manager->problem('absturz'));
|
||||
$this->assertFileDoesNotExist($marker);
|
||||
$this->assertFileDoesNotExist(storage_path('framework/plugins/strike-absturz'));
|
||||
}
|
||||
|
||||
public function test_fresh_marker_with_old_file_time_is_not_a_crash(): void
|
||||
{
|
||||
// Netzlaufwerk mit nachgehender Uhr: Dateizeit alt, Inhalt aktuell – lädt gerade parallel
|
||||
$this->makePlugin('parallel', base: 'core');
|
||||
$marker = storage_path('framework/plugins/booting-parallel');
|
||||
@mkdir(dirname($marker), 0777, true);
|
||||
@unlink(storage_path('framework/plugins/strike-parallel'));
|
||||
|
||||
foreach ([1, 2] as $round) {
|
||||
file_put_contents($marker, (string) time());
|
||||
touch($marker, time() - 600);
|
||||
$manager = $this->manager();
|
||||
$manager->registerAll();
|
||||
$this->assertTrue($manager->isEnabled('parallel'), "Runde {$round}");
|
||||
}
|
||||
|
||||
$this->assertFileDoesNotExist(storage_path('framework/plugins/strike-parallel'));
|
||||
}
|
||||
|
||||
public function test_customer_plugins_are_inactive_until_activated(): void
|
||||
|
|
@ -457,8 +484,7 @@ class PluginSystemTest extends TestCase
|
|||
// Absturz mitten im Update (Markierung aus dem Update-Zeitraum)
|
||||
$marker = storage_path('framework/plugins/booting-absturz');
|
||||
@mkdir(dirname($marker), 0777, true);
|
||||
file_put_contents($marker, '1');
|
||||
touch($marker, time() - 150);
|
||||
file_put_contents($marker, (string) (time() - 150));
|
||||
|
||||
// Von einer älteren Version während des Updates abgeschaltet
|
||||
$state = new PluginState($this->dir.'/state.json');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue