[AZ-488] fix: seed UavUploadTests coordinate counter from wall-clock
ci/woodpecker/push/01-test Pipeline was successful
ci/woodpecker/push/02-build-push Pipeline was successful

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 <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-11 23:53:44 +03:00
parent 1802d32107
commit dc3dabe7bd
@@ -350,7 +350,12 @@ public static class UavUploadTests
return stream.ToArray(); 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() private static (double Latitude, double Longitude) NextTestCoordinate()
{ {