test: stretch the lease renewal test on a busy runner
CI / Build and test (pull_request) Successful in 5m54s
CI / Windows tests and installer (pull_request) Skipped
CI / YAML check (pull_request) Successful in 5s
CI / PostgreSQL 16 integration (pull_request) Successful in 4m14s
CI / PostgreSQL 17 integration (pull_request) Successful in 4m24s
CI / Docker image (pull_request) Successful in 59s

Its 300 ms lease is renewed by a 100 ms timer; on the shared CI host the timer
came 700 ms late once. The duration now follows TestTiming like the other
timed tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-10-23 14:20:12 +02:00
1 parent ee2d32f70f
commit 66dd86d154
2 files changed
+6 -4

No files matched your search

+1 -1
View File
@@ -427,5 +427,5 @@ One line per decision: date · decision · alternative · reason.
| 2026-10-23 | The server image is built for linux/amd64 only and pushed to the Gitea container registry (`<host of PUBLIC_URL>/<owner>/chronos-server`) with the `REGISTRY_TOKEN` secret; `:latest` moves only to the highest stable version among the published releases, read back after publishing. The workflow's own token is refused by the organisation's registry (measured), so without the secret the image job fails with instructions while the release itself is already published. (R3.) | Multi-arch with QEMU; fail the whole release | Multi-arch needs QEMU's binfmt handlers installed on the owner's host, a change to the host outside the repository; the Windows programs should not wait on a registry credential. |
| 2026-10-23 | The Windows-only CI (Core.Windows and App tests, screenshots and their diff, the installer test) is the `windows` job, run only when the repository variable `WINDOWS_RUNNER` names a Windows act_runner in host mode; until then those tests run on a Windows PC before a merge. The Definition of Done says so (CLAUDE.md, BRIEF Appendix A). (R3.) | Drop them; fail CI without a Windows runner | They are the only automatic proof of the installer and the screens; a job that waits for a runner that does not exist would hold every run. |
| 2026-10-23 | Update check: the client reads the published stable releases and takes the highest version, because Gitea's `releases/latest` is the most recently created release (a re-published older tag or a backport would become it); a pre-release build (`0.1.0-rc.1`) is offered the final release of its own version, which it used to call "up to date" forever; a 404 is a failed check, because Gitea answers 404 for a repository the client may not see (the `BalboSoft` organisation is private today) and that used to read as "up to date". The release workflow picks `:latest` the same way. `gitea-release` checks every file's size before it publishes, and when it replaces the files of a release clients can already see it removes the old `SHA256SUMS` first and uploads the new one last. (R2, R3; independent review of this change.) | Trust `releases/latest`; leave the pre-release rule as it was | The first release is a pre-release: its testers must be told when 0.1.0 is out; a download checked against the checksums of another build would be refused. |
| 2026-10-23 | Timed tests (bulk insert, JPEG and RAW decode, resampler, light analysis, metadata robustness, scroll smoke) take their budget from `TestTiming.Budget`, stretched by `CHRONOS_TEST_TIME_FACTOR` (at least 1, default 1); ci.yml and release.yml set 3, perf.yml nothing. On the owner's runner, which shares its CPU and disks with Gitea and the server's other containers, the 100k-frame SQLite bulk insert took 10–19 s against 15 s from one run to the next. (R3.) | Raise the budgets; move the timed tests to perf.yml | The budgets stay what a developer's PC must meet and the weekly performance gates measure them unstretched; a CI run fails on a real regression, not on a busy host. |
| 2026-10-23 | Timed tests (bulk insert, JPEG and RAW decode, resampler, light analysis, metadata robustness, scroll smoke, and the lease renewal test's timer periods) take their budget from `TestTiming.Budget`, stretched by `CHRONOS_TEST_TIME_FACTOR` (at least 1, default 1); ci.yml and release.yml set 3, perf.yml nothing. On the owner's runner, which shares its CPU and disks with Gitea and the server's other containers, the 100k-frame SQLite bulk insert took 10–19 s against 15 s from one run to the next. (R3.) | Raise the budgets; move the timed tests to perf.yml | The budgets stay what a developer's PC must meet and the weekly performance gates measure them unstretched; a CI run fails on a real regression, not on a busy host. |
| 2026-10-23 | The update check builds the release page (`<repository>/releases/tag/<tag>`) and the download links (`<repository>/releases/download/<tag>/<name>`) from `ChronosReleasesUrl` and takes only the tags, names and sizes from Gitea's answer: Gitea writes `html_url` and `browser_download_url` with its ROOT_URL, the owner's being `http://192.168.30.23:3000`, so the first release's links were plain http on a LAN address and the https-only check ignored the release. Without a repository address (tests) the answer's links are used as before. (R2, after the first release.) | Ask the owner to set ROOT_URL to the public https name | The build already names the address its users reach; the client then works whatever Gitea's ROOT_URL is, and a ROOT_URL change stays the owner's choice. |
@@ -66,12 +66,14 @@ public sealed class LeaseFileTests(TestContext context)
public async Task AHeldLeaseIsRenewedPastItsDuration()
{
var locks = context.CreateTempDirectory();
using var lease = LeaseFile.TryAcquire(locks, "seq-1", "server", TimeSpan.FromMilliseconds(300));
// Renewals run on timers: a busy CI host delays them, so the lease's duration stretches with the time budgets.
var duration = TimeSpan.FromSeconds(TestTiming.Budget(0.3));
using var lease = LeaseFile.TryAcquire(locks, "seq-1", "server", duration);
Assert.NotNull(lease);
await Task.Delay(900);
await Task.Delay(duration * 3);
Assert.True(lease.IsHeld);
Assert.Greater((LeaseFile.Read(lease.Path)!.Expires - DateTimeOffset.UtcNow).TotalMilliseconds, 0);
Assert.Null(LeaseFile.TryAcquire(locks, "seq-1", "client", TimeSpan.FromMilliseconds(300)));
Assert.Null(LeaseFile.TryAcquire(locks, "seq-1", "client", duration));
}
[Test]