Skip to content

test(blackbox): activate discovery and model its ingestion deterministically - #659

Open
JeroenSoeters wants to merge 1 commit into
mainfrom
test/discovery-activation
Open

test(blackbox): activate discovery and model its ingestion deterministically#659
JeroenSoeters wants to merge 1 commit into
mainfrom
test/discovery-activation

Conversation

@JeroenSoeters

Copy link
Copy Markdown
Collaborator

Why

The suite's formas never marked the target Discoverable, so ForceDiscover always ended at "No discoverable targets found" and ingested nothing. The whole unmanaged-inventory surface — ApplyDiscoveryToUnmanaged, the expectation side of CheckUnmanagedModelVsInventory, the unmanaged drift absorption added in #656 — was structurally dead. Worse, the old trigger applied the ingestion transition whenever any sync command happened to be observed in its 10-second window, arming expectations for rows that were never ingested (a latent flake source).

What

  • The target is discoverable and OpTriggerDiscovery performs real, modeled ingestion. Discovered probe runs exercise 5-6 genuine ingestions per 25 chaos iterations.
  • Ingestion is gated on quiescence and preceded by an orphan sweep. Discovery ingests every cloud entry inventory does not know — including orphans that failed/canceled commands leave behind (created in the cloud, never persisted), and an ingested orphan is not derivable from generated inputs. So the trigger runs only with no commands in flight, after sweeping cloud entries that are neither in inventory nor tracked out-of-band resources; what remains for discovery to find is exactly the model's tracked set. The trigger records the predicted ingestion (ApplyDiscoveryToUnmanaged) and waits for the unmanaged inventory to converge, retrying the trigger since discovery pauses during user changesets. This mirrors the drift-op design from test(blackbox): compute drift end states deterministically instead of tolerating a sync window #656: out-of-band effects absorb synchronously under quiescence, and the model computes the end state.
  • Iteration hygiene grows matching teeth. The reset now sweeps leftover cloud entries on every exit path (previously the early "inventory clean" return skipped the sweep, leaking undiscovered out-of-band creates into the next iteration), and purges ingested unmanaged rows by deleting their cloud entries and letting a forced sync absorb the deletions — the managed-only destroy cannot remove $unmanaged rows. The mid-iteration orphan sweep now spares tracked out-of-band resources so it cannot delete something a later discovery is expected to find.

Each of the three probe failures en route pinpointed one of these: unswept cross-iteration cloud leftovers being ingested, surviving $unmanaged rows orphaned by the new sweep, and an orphaned cross-stack create being ingested as a duplicate-NativeID unmanaged row.

Verification

  • TestProperty_FullChaos green twice at 25 checks with 5 and 6 real ingestions respectively; the four other property suites green at 8 checks; full model unit tests green.
  • go vet clean under property and integration tags.

Fixes the gap tracked in PLA-714 (internal).

…tically

The suite's formas never marked the target Discoverable, so every forced
discovery ended at "no discoverable targets" and ingested nothing: the
unmanaged-inventory expectations, the discovery model transition, and the
unmanaged drift absorption were all dead surface. Worse, the old trigger
applied the ingestion transition whenever any sync command happened to be
observed in its window, arming expectations for rows that were never
ingested.

The target is now discoverable and the trigger is deterministic.
Discovery ingests every cloud entry inventory does not know, which
includes orphans a failed or canceled command left behind, and an
ingested orphan is not derivable from generated inputs; so the trigger
only performs discovery when no commands are in flight, after sweeping
every cloud entry that is neither in inventory nor a tracked out-of-band
resource. What remains for discovery to find is then exactly the model's
tracked set: the trigger records the predicted ingestion and waits for
the unmanaged inventory to converge on it, retrying the trigger since
discovery pauses while a user changeset runs.

Iteration hygiene grows the matching teeth: the reset now sweeps cloud
entries a previous iteration left behind on every exit path, and purges
ingested unmanaged rows by deleting their cloud entries and letting a
forced sync absorb the deletions, since the managed-only destroy cannot
remove them. The mid-iteration orphan sweep spares tracked out-of-band
resources so it cannot delete something a later discovery is expected to
find.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant