Skip to content

documentdb-local: no end-to-end coverage for lifecycle, durability, and default security posture #688

Open

Description

@guanzhousongmicrosoft

Summary

test_image.py covers per-flag smoke behavior, but nothing covers the
operational contract users depend on once a container is actually in use:
restarts, crashes, durability, and the security posture of the defaults.

Gaps

None of the following is exercised today:

Lifecycle

  • docker stop completing inside Docker's default 10s grace period, with a
    clean PostgreSQL shutdown (a container SIGKILLed at the grace deadline
    exits 137 and risks the data directory).
  • Recovery after SIGKILL (the OOM-killer / host-crash analog): WAL recovery
    on the next boot with the acknowledged write intact.
  • The supervision contract: if the gateway dies, the container must exit so
    an orchestrator restarts it, rather than sitting there serving nothing.

Durability

  • A volume backup/restore round trip, including a restore performed as root
    (which is what a tar/docker cp based restore produces, and which
    exercises the entrypoint's ownership repair).

Security posture of the defaults

  • The PostgreSQL port must not be reachable from outside the container by
    default, and must be reachable with --allow-external-connections true.
    This is a regression guard: it was accidentally always-on once already.
  • The operator password must not appear in container logs or the process
    list.

Configuration surface

  • Custom --pg-port, a custom TLS certificate verified against its own CA
    (i.e. without disabling certificate validation), --log-level.
  • A memory-capped container (768MB, the laptop/CI reality for a local dev
    database) still serving reads and writes.
  • Concurrent writers all succeeding with a consistent final document count.

Negative

  • A corrupt data directory failing with an actionable message.

Proposal

Add an end-to-end suite alongside test_image.py covering the above, and run
it in the image build workflow. Engine and wire-protocol semantics stay out
of scope — that is the functional-tests gate's job. This suite should assert
only the image's operational contract.

Activity

  1. added
    emulator
    enhancement
    on Jul 27, 2026
  2. documentdb-triage-tool commented on Jul 27, 2026

    @documentdb-triage-tool

    🤖 Auto-triaged by documentdb-triage-tool.

    Applied: emulator, enhancement, performance
    Project fields suggested: Component documentdb-local · Priority P0 · Effort L · Status In Progress
    Confidence: 0.88 (mixed)

    Reasoning

    P0 keyword "crash" in body; LLM: Adds a comprehensive end-to-end operational test suite (lifecycle, durability, security posture, config surface, negative cases) for the documentdb-local container image, covering multiple distinct scenarios across several files.

    If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

  3. documentdb-triage-tool commented on Aug 11, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  4. documentdb-triage-tool commented on Aug 26, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  5. documentdb-triage-tool commented on Sep 9, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  6. documentdb-triage-tool commented on Sep 23, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  7. added this to the 1.0 milestone on Oct 5, 2026
  8. guanzhousongmicrosoft commented on Oct 5, 2026

    @guanzhousongmicrosoft
    MemberAuthor

    Status: the 1.0-RC2 branch adds tests for persistence across container recreation and for the data-directory interlock. Still missing:

    • docker stop finishing cleanly within 10 s (no exit 137)
    • the container exiting when the gateway dies
    • volume backup/restore, including restore as root
    • the PG port closed by default and open with --allow-external-connections
    • the password absent from logs and ps
    • --log-level
    • a memory-capped run
    • concurrent writers
    • an actionable error on a corrupt data dir

    Targeting 1.0.

  9. documentdb-triage-tool commented on Oct 28, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 23 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  10. documentdb-triage-tool commented on Nov 11, 2026

    @documentdb-triage-tool

    👋 @guanzhousongmicrosoft — this issue has been assigned for 14 days with no activity. Is it still in progress? If you've made progress, please leave a quick update. Otherwise it'll be flagged for re-assignment at the next triage meeting.

  11. guanzhousongmicrosoft commented on Nov 23, 2026

    @guanzhousongmicrosoft
    MemberAuthor

    Part of this is on main: test_image.py now covers SIGKILL and crash recovery, persistence across recreation, the data-directory interlock, and the password being absent from every process's argv (cf53d26, 78f994e, 23d9788). The other scenarios in the list are still missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentdb-1.0emulatorenhancementperformance

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions