CI / Build and test (push) Successful in 13m44s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 16s
Release / Build, test and publish (push) Successful in 26m34s
CI / PostgreSQL 16 integration (push) Failing after 17m36s
CI / PostgreSQL 17 integration (push) Failing after 15m36s
CI / Docker image (push) Successful in 1m12s
Release / Server image (push) Failing after 15s
The same time-lapse on a server and on this PC under different ids, or twice on this PC, is recognised, compared and settled as the owner asked in owner review 6. Matches are found after each sync refresh, through the server's new photo lookup, and after the jobs that change photos. The default is to ask every time. Server › Matches offers: - Keep apart, which is remembered; - Link only and Unlink; - the Compare dialog: photos, details line by line, projects and the plan. Integrate completes both sides. Photos default to Union, projects are copied across, and a losing version goes to the trash only after a hash check. Afterwards new photos move by themselves, and deletions wait for the user. A merge of two local sequences verifies every photo before the other sequence goes to its archive's trash. Upload all local skips suspected matches and flags them. Migration 0012 adds the found_copies and copy_probes tables. Jobs 25 (Integrate) and 26 (MergeSequences) are new, and so are the server capabilities photo-lookup and upload-into. Refs #73 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
47 lines
1.8 KiB
C#
47 lines
1.8 KiB
C#
using Chronos.Data.Copies;
|
|
using Chronos.Data.Tests.Infrastructure;
|
|
using Chronos.Testing;
|
|
|
|
namespace Chronos.Data.Tests.Perf;
|
|
|
|
/// <summary>
|
|
/// Owner review 6 (#73), design §3.4: local detection's SHA-256 join over the 500,000-photo library answers in under 2 s
|
|
/// (every photo unique: the join finds no pair, which is the whole index read). Opt-in: <c>CHRONOS_PERF=1</c>.
|
|
/// </summary>
|
|
[Category("perf")]
|
|
[RequiresEnvironment(PerfGate.Variable)]
|
|
[Serial]
|
|
[Timeout(3_600_000)]
|
|
public abstract class CopyOverlapPerfTests(TestContext context) : RepositoryTest(context)
|
|
{
|
|
public const double BudgetMs = 2_000;
|
|
|
|
[Test]
|
|
public async Task LocalOverlapsAreFoundWithinTheGate()
|
|
{
|
|
var options = await NewOptionsAsync(multiConnection: true);
|
|
await using (var build = await ChronosDatabase.OpenAsync(options, Ct)) await SyntheticLibrary.BuildAsync(build, Context);
|
|
|
|
var db = Own(await ChronosDatabase.OpenAsync(options, Ct));
|
|
var store = new FoundCopyStore(db);
|
|
IReadOnlyList<LocalOverlap> overlaps = [];
|
|
var first = await PerfGate.TimeAsync(async () => overlaps = await store.LocalOverlapsAsync(Ct));
|
|
var again = await PerfGate.MedianAsync(() => store.LocalOverlapsAsync(Ct));
|
|
Context.Log($"perf: {Dialect} local overlaps {first:F0} ms first, {again:F0} ms again (budget {BudgetMs:F0} ms), {overlaps.Count} pairs");
|
|
|
|
Assert.Empty(overlaps);
|
|
Assert.LessOrEqual(first, BudgetMs);
|
|
}
|
|
}
|
|
|
|
public sealed class SqliteCopyOverlapPerfTests(TestContext context) : CopyOverlapPerfTests(context)
|
|
{
|
|
protected override Backend Backend => Backend.SqliteFile;
|
|
}
|
|
|
|
[RequiresEnvironment(PgTestServer.Variable)]
|
|
public sealed class PostgresCopyOverlapPerfTests(TestContext context) : CopyOverlapPerfTests(context)
|
|
{
|
|
protected override Backend Backend => Backend.Postgres;
|
|
}
|