Skip to content

Add regression coverage for queue metadata/policy persistence across restarts - #2768

Draft
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 2 commits into
mainfrom
copilot/store-queues-state-for-docker-images
Draft

Add regression coverage for queue metadata/policy persistence across restarts#2768
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 2 commits into
mainfrom
copilot/store-queues-state-for-docker-images

Conversation

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Users requested the ability to persist queue state (queues, metadata, and stored access policies) so pre-initialized test environments and Docker images could be built without custom startup scripts, mirroring existing blob container persistence.

Investigation

  • Confirmed LokiQueueMetadataStore already persists queues, metadata, and access policies (ACLs) to disk via LokiJS, on par with blob container persistence, enabled by default unless --inMemoryPersistence is set.
  • Manually verified end-to-end: created a queue with metadata via the Azure SDK, gracefully restarted the server against the same data directory, and confirmed the queue, metadata, and access policy all survived.

Changes

  • Added tests/queue/queuePersistence.test.ts: a disk-backed regression test that creates a queue with metadata and an access policy, restarts the QueueServer against the same DB paths, and asserts all three survive the restart.
await queueClient.create({ metadata: { key: "value" } });
await queueClient.setAccessPolicy(queueAcl);
await server.close();

// New server instance, same metadata/extent DB paths
server = createServer();
await server.start();
const properties = await queueClient.getProperties();
assert.deepStrictEqual(properties.metadata, { key: "value" });

No production code changes were required — this PR locks in the existing behavior with explicit regression coverage.

Copilot AI lite review requested due to automatic review settings September 2, 2026 12:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 2, 2026 12:48
Copilot AI changed the title [WIP] Add state persistence for queues in Docker images Add regression coverage for queue metadata/policy persistence across restarts Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new test includes a service-port mismatch and uses an invalid ISO date plus an overly strict equality assertion that can make the regression coverage brittle or misleading.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment on lines +25 to +27
const host = "127.0.0.1";
const port = 11002;
const metadataDbPath = "__queuePersistenceTestsStorage__";
Comment on lines +94 to +97
accessPolicy: {
expiresOn: new Date("2030-11-31T11:22:33.4567890Z"),
permissions: "raup",
startsOn: new Date("2017-12-31T11:22:33.4567890Z")
Comment on lines +128 to +130

const policyResult = await queueClient.getAccessPolicy();
assert.deepStrictEqual(policyResult.signedIdentifiers, queueAcl);
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.

Store the state of queues for creating pre initialized Docker images

3 participants