mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 10:31:14 +00:00
[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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user