Commit b0316b5e authored by kzangeli's avatar kzangeli
Browse files

fix: 020_17-020_20 teardown — delete the current-state twin as well

The #9 setup fix pairs each temporal test's POST /temporal/entities
with a current-state Create Entity, but the teardown removed only the
temporal representation. The surviving current-state Vehicles (eight
across the four suites) pollute every later unpinned type=Vehicle
query: all nine D011_* tests plus D001_01_inc/D001_02_inc/
D001_03_03_inc assert an exact URI set against their mock's single
entity and fail with 'Lengths are different: 1 != 9' in full-suite
runs (they pass in isolation). Each leaked entity id in output.xml
traces back to 020_17_01..03 / 020_18_01..03 / 020_19_01 / 020_20_01.

Teardown now calls Delete Entity before Delete Temporal Representation
Of Entity — that order also purges the deletion's own tombstone rows
from the temporal store.

Analysis recorded as testsuite-doubts.md #93.
parent 36297ca9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -63,4 +63,8 @@ Create Temporal Entity
    Set Suite Variable    ${temporal_entity_representation_id}

Delete Initial Temporal Entity
    # The setup mirrors the temporal entity on the current-state side (see
    # testsuite-doubts.md #9) — remove that twin too, or it pollutes every
    # later type=Vehicle query (exact-set assertions in the dist-ops tests).
    Delete Entity    ${temporal_entity_representation_id}
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+4 −0
Original line number Diff line number Diff line
@@ -66,4 +66,8 @@ Create Temporal Entity
    Set Suite Variable    ${temporal_entity_representation_id}

Delete Initial Temporal Entity
    # The setup mirrors the temporal entity on the current-state side (see
    # testsuite-doubts.md #9) — remove that twin too, or it pollutes every
    # later type=Vehicle query (exact-set assertions in the dist-ops tests).
    Delete Entity    ${temporal_entity_representation_id}
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+4 −0
Original line number Diff line number Diff line
@@ -57,4 +57,8 @@ Create Temporal Entity
    Set Suite Variable    ${temporal_entity_representation_id}

Delete Initial Temporal Entity
    # The setup mirrors the temporal entity on the current-state side (see
    # testsuite-doubts.md #9) — remove that twin too, or it pollutes every
    # later type=Vehicle query (exact-set assertions in the dist-ops tests).
    Delete Entity    ${temporal_entity_representation_id}
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+4 −0
Original line number Diff line number Diff line
@@ -58,4 +58,8 @@ Create Temporal Entity
    Set Suite Variable    ${temporal_entity_representation_id}

Delete Initial Temporal Entity
    # The setup mirrors the temporal entity on the current-state side (see
    # testsuite-doubts.md #9) — remove that twin too, or it pollutes every
    # later type=Vehicle query (exact-set assertions in the dist-ops tests).
    Delete Entity    ${temporal_entity_representation_id}
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+23 −0
Original line number Diff line number Diff line
@@ -2701,3 +2701,26 @@ with the string `"urn:ngsi-ld:null"`:

- 020-19 (normalized): `"value": "urn:ngsi-ld:null"`
- 020-20 (temporalValues): `[ "urn:ngsi-ld:null", "…" ]`
## 93. `020_17`–`020_20` teardown leaks the current-state twin — 12 dist-ops tests fail by contamination

**Hit (full-suite runs only):** all nine `D011_*` query tests plus
`D001_01_inc` / `D001_02_inc` / `D001_03_03_inc` fail with
`Lengths are different: 1 != 9` (or downstream variants:
`KeyError: 'brandName'`, `No value found for path $.speed`). In isolation
they all pass.

**Analysis:** the [[#9]] setup fix paired each `020_17``020_20` temporal
test's `POST /temporal/entities` with a current-state `Create Entity` (so
the `DELETE /entities/{id}/attrs/{name}` under test has a target). But
`Delete Initial Temporal Entity` tears down only the temporal
representation — the current-state twin survives. Eight Vehicles (one per
test case across the four suites) accumulate in the broker and surface in
every later unpinned `type=Vehicle` query; the dist-ops tests assert an
exact URI set against the mock's single entity, so they see 9 where they
expect 1. Verified by tracing each leaked entity id in the robot
`output.xml` back to its creating test: 020_17_01..03, 020_18_01..03,
020_19_01, 020_20_01.

**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).