← Back to Pull requests

tests: add Go integration suite on a single node kind cluster #403

Open
unknown opened this pull request with 373 lines diff across 4 files
View on GitHub
unknown unknown commented on Oct 28, 2026 09:00 UTC
Author

What

A Go integration test suite in tests/integration that runs dranet against a single node kind cluster.

make integration-test

It sits between the unit tests and the bats e2e suite: real apiserver, scheduler, resourceclaim controller, kubelet and containerd/NRI, but no image build, kind load or DaemonSet rollout. The dranet binary is built on the host, copied into the node container and run as a transient systemd unit. A cold run takes ~50 s to create the cluster; with DRANET_KIND_REUSE=1 a code change is a rebuild and a restart of the driver, a few seconds.

Tests use client-go for the cluster and docker exec for the node. Each test gets its own namespace and dummy links with unique names. On failure the dranet journal and the pods, events, claims and slices are written to _artifacts/integration/. A new integration workflow runs the suite on pull requests.

Tests

  • TestSmoke: a link is published, a pod claims it, the link moves into the pod with its address, after the pod is gone the link is back on the node and the slice no longer advertises the address.

  • TestFastReschedule: the fast pod re-schedule race. Pod 1 holds a link, pod 2 waits for the same link with the dra.net/ipv4 CEL selector, pod 1 is deleted and the address comes back on the link 2 s later (standing in for DHCP / the guest agent). The test checks that pod 2 is not scheduled before the address is back, that it is scheduled soon after, and that its claim reports the address. It runs with PersistentResourceSliceAttributes on and off.

  • TestNRITimeout: the NRI failure policy from #401. A pod with 3 claims × 32 devices makes RunPodSandbox take ~3.5 s, past containerd's default 2 s plugin_request_timeout. The pod must fail to start with a FailedCreatePodSandBox event naming the plugin, the dranet_driver_nri_plugin_disconnects_total counter must not move, and a later one-device pod must still start.
  • Current result

    TestSmoke passes. The other two fail on purpose and document gaps:

  • TestFastReschedule: an address change does not trigger an inventory rescan, so pod 2 is scheduled ~58 s after the address is restored (the max poll interval). With PersistentResourceSliceAttributes=true the snapshot merge sometimes keeps a stale dra.net/ipv4 in the slice after the link returned; pod 2 is then scheduled at once and takes the link with no address, and its claim ends with empty networkData.ips. Timing dependent: the window is about one inventory scan long.

  • TestNRITimeout: the kind v1.37.0 node image ships containerd 2.3.4 with NRI v0.12.0, which predates the failure policy (needs ≥ v0.12.4). containerd logs closing plugin 00-dra.net, failed to handle RunPodSandbox request: context deadline exceeded, proceeds without dranet, and the pod starts with no interfaces. The test passes once the node image carries a containerd with NRI ≥ v0.12.4.
  • The fixes are follow-ups; this PR adds the harness and the reproductions.

    Diff: 373 lines (+279 / -94) across 4 files Reviewer: aojea Review duration: 13961m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.43) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 373 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.354
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #403"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.8% (MEDIUM) · Higher = larger blast radius
    42.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.8% · Safe to merge
    22.8%