Commit 54cc34dd authored by kzangeli's avatar kzangeli
Browse files

fix: 008_01 — a second temporal POST appends, it does not overwrite

The expectation reused the update payload verbatim, assuming the second
POST /temporal/entities replaced instances sharing an observedAt and
deduplicated identical ones — current-state update semantics applied to
the Temporal Evolution. Per TS 104-175 § 5.6.11.4 the provided
Attribute instances 'shall be added to the existing Temporal
Representation': instance identity is the system-generated instanceId,
never observedAt, and the evolution is append-only.

The expectation now carries the full union: speed 120@12:03 + 121@12:03
+ 80@12:05 x2 + 100@12:07, fuelLevel 67 x2 + 53 x2 + 40 + 40@datasetId.

Analysis recorded as testsuite-doubts.md #94.
parent b0316b5e
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@
      "id":"urn:ngsi-ld:Vehicle:randomUUID",
      "type":"Vehicle",
      "speed":[
         {
            "type":"Property",
            "value":120,
            "observedAt":"2020-09-01T12:03:00Z"
         },
         {
            "type":"Property",
            "value":121,
@@ -12,6 +17,11 @@
            "value":80,
            "observedAt":"2020-09-01T12:05:00Z"
         },
         {
            "type":"Property",
            "value":80,
            "observedAt":"2020-09-01T12:05:00Z"
         },
         {
            "type":"Property",
            "value":100,
@@ -24,6 +34,16 @@
            "value":67,
            "observedAt":"2020-09-01T12:03:00Z"
         },
         {
            "type":"Property",
            "value":67,
            "observedAt":"2020-09-01T12:03:00Z"
         },
         {
            "type":"Property",
            "value":53,
            "observedAt":"2020-09-01T13:05:00Z"
         },
         {
            "type":"Property",
            "value":53,
+20 −0
Original line number Diff line number Diff line
@@ -2724,3 +2724,23 @@ expect 1. Verified by tracing each leaked entity id in the robot
**Fix:** teardown deletes the current-state entity too — `Delete Entity`
before `Delete Temporal Representation Of Entity` (that order also purges
the deletion's own tombstone rows from the temporal store).
## 94. `008_01_01` — expectation assumes a second temporal POST overwrites same-observedAt instances

**Hit:** `Item root['speed'][1] added to iterable` (and friends) — the broker
returns more Attribute instances than the expectation contains.

**Analysis:** the test POSTs `/temporal/entities` twice for the same entity:
the create payload (`speed` 120@12:03, 80@12:05) and an "update" payload
(`speed` 121@12:03, 80@12:05, 100@12:07). The expectation file is the update
payload itself — i.e. it assumes the second POST *replaced* the instances
sharing an `observedAt` (120@12:03 → 121@12:03) and deduplicated the
identical ones (80@12:05). That is current-state update semantics applied to
the Temporal Evolution. Per TS 104-175 § 5.6.11.4, when the entity already
exists, the provided Attribute instances "shall be **added** to the existing
Temporal Representation" — instance identity is the system-generated
`instanceId`, never `observedAt`, and the evolution is append-only. A
conforming broker therefore returns the union: 5 `speed` instances
(120@12:03, 121@12:03, 80@12:05 ×2, 100@12:07) and 6 `fuelLevel` instances.

**Fix:** the expectation now carries the full union (including the duplicate
same-value/same-observedAt instances, which exist as distinct `instanceId`s).