mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 18:23:40 +00:00
fix(upgrade): use authenticated status polling after restart
Remove the version header from the health endpoint and use upgrade status polling to determine completion.
This commit is contained in:
@@ -119,23 +119,24 @@ it('ignores stale status files older than ten minutes', function () {
|
||||
expect($result['status'])->toBe('none');
|
||||
});
|
||||
|
||||
it('waits for the running version to match the target before showing reload', function () {
|
||||
it('checks the running version through authenticated upgrade status before showing reload', function () {
|
||||
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
|
||||
|
||||
expect($upgradeView)
|
||||
->toContain('X-Coolify-Version')
|
||||
->toContain('hasReachedTargetVersion')
|
||||
->not->toContain('X-Coolify-Version')
|
||||
->toContain('this.$wire.getUpgradeStatus()')
|
||||
->toContain("data.status === 'complete'")
|
||||
->toContain('livewireFailures');
|
||||
});
|
||||
|
||||
it('treats a healthy instance without a version header as ready only after downtime', function () {
|
||||
it('uses the public health endpoint only for liveness during an upgrade', function () {
|
||||
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
|
||||
|
||||
expect($upgradeView)
|
||||
->toContain('instanceWentDown')
|
||||
->toContain('isReadyToReload')
|
||||
->toContain('startHealthWatch')
|
||||
->toContain('data.status === \'none\'');
|
||||
->toContain("fetch('/api/health')")
|
||||
->not->toContain('response.headers.get');
|
||||
});
|
||||
|
||||
it('starts the upgrade after the Livewire response so status polling is not blocked', function () {
|
||||
|
||||
Reference in New Issue
Block a user