From dc3dabe7bdcd3a07a114790eee5b68519f12ca2b Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Mon, 11 May 2026 23:53:44 +0300 Subject: [PATCH] [AZ-488] fix: seed UavUploadTests coordinate counter from wall-clock Postgres data volume persists across docker-compose runs. The previous `int _coordinateCounter = 0` reset on every test-runner process start so the SECOND `--full` run collided with rows seeded by the first `--smoke` run (the AC-3 MultiSourceCoexistence test does a raw INSERT for the pre-seed step, not an UPSERT, and the unique constraint fires). Seed the counter from a wall-clock value (~Unix epoch seconds mod 1M) so each runner process picks a distinct coordinate band. Eliminates inter-run collisions without coupling the test to docker volume reset. Co-authored-by: Cursor --- SatelliteProvider.IntegrationTests/UavUploadTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SatelliteProvider.IntegrationTests/UavUploadTests.cs b/SatelliteProvider.IntegrationTests/UavUploadTests.cs index 489a47f..0d2a8ae 100644 --- a/SatelliteProvider.IntegrationTests/UavUploadTests.cs +++ b/SatelliteProvider.IntegrationTests/UavUploadTests.cs @@ -350,7 +350,12 @@ public static class UavUploadTests return stream.ToArray(); } - private static int _coordinateCounter; + // Seed the counter from a wall-clock value so each test-runner process picks a + // distinct coordinate band. Postgres state persists across docker-compose runs + // (named volume); a monotonic counter from 0 would collide with prior runs on + // the per-source unique index, especially for tests that seed rows via raw + // INSERT rather than the API's UPSERT path. + private static int _coordinateCounter = (int)((DateTime.UtcNow.Ticks / TimeSpan.TicksPerSecond) % 1_000_000); private static (double Latitude, double Longitude) NextTestCoordinate() {