Broken `telemetry` test suite

Issue Description

While working on my stalwart branch which add support for large files, I noticed that some tests are broken.

Expected Behavior

telemetry::telemetry_tests tests to succeed in a release tag of stalwart

Actual Behavior

Tests fail due to a primaryKeyViolation

Reproduction Steps

cargo test -p tests telemetry

Relevant Log Output

test telemetry::telemetry_tests ... FAILED

failures:

---- telemetry::telemetry_tests stdout ----
Running Alerts tests...
Running Metrics tests...
Running Tracing tests...

thread 'telemetry::telemetry_tests' (488149) panicked at tests/src/utils/jmap.rs:566:32:
Missing created item 0: {
  "methodResponses": [
    [
      "x:Account/set",
      {
        "accountId": "b",
        "notCreated": {
          "i0": {
            "type": "primaryKeyViolation",
            "properties": [
              "email"
            ],
            "objectId": {
              "object": "Account",
              "id": "b"
            }
          }
        }
      },
      "0"
    ]
  ],
  "sessionState": "2fe6f709"
}

Stalwart Version

v0.16.x

Installation Method

Built from source

Database Backend

RocksDB

Blob Storage

Filesystem

Search Engine

Internal

Directory Backend

Internal

Additional Context

Seems like the test tries to create_user_account with [email protected] twice.

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

This confirms the reported bug: in tracing.rs, the test tries to create_user_account with username, email, and display name all set to [email protected], which duplicates the email of the admin account already created in mod.rs ([email protected]), causing the primaryKeyViolation on the email field.

I have enough to answer this as a genuine test bug report, not really a “how do I use Stalwart” question. I should report this rather than provide a workaround, since it’s a code issue in the test suite.

This is a real bug in the test suite: in tests/src/telemetry/mod.rs, the admin account is created with email [email protected], but tests/src/telemetry/tracing.rs then calls create_user_account again using [email protected] for both the login name and email, which collides with the existing account’s email and triggers the primaryKeyViolation. This looks like a copy-paste mistake (the tracing test likely intended to create a distinct user, not reuse the admin’s address).

This is a code-level issue rather than a documentation or configuration question, so it’s best tracked as a bug for the Stalwart team to fix directly in the test suite. A staff member will likely follow up here to confirm and patch it.

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

Fixed in the repository.