test(messaging): wait for the applied callback counter in the dev end-to-end check

オープン 初心者向け
#2,916 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
88/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker, postgresql, rust, shell
領域
backend, testing

調査の方向性

products/messaging/scripts/test-dev.shを読み、SMSのステータスを待った後にmessaging_provider_callbacks_total{outcome="applied"}メトリクスを確認している箇所を見つけてください。既存の制限付き待機時間内でメトリクスをポーリングし、期待値は1のままにして、タイムアウト時には最後の値を報告してください。Dockerでスクリプトを実行し、その後ShellCheckとshfmt -dで確認してください。チェックがカウンターを待ち、重複したコールバックを引き続き拒否すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

What fails

products/messaging/scripts/test-dev.sh can fail in the Messaging PostgreSQL runtime CI job with:

test-dev: GET /v1/messages/<sms>: status delivered
test-dev: GET /v1/messages/<email>: status submitted
test-dev: Mailpit holds 1 message
test-dev: 0 signed callbacks were applied, expected 1

It failed once on pull request #2913, in a run whose changes touch no Messaging code or script. The same job passed on the previous two runs.

Why

The script waits, with a bound, until the SMS reads delivered. It then reads messaging_provider_callbacks_total{outcome="applied"} once.

The runtime records that counter after the callback is handled. In crates/registry-messaging/src/callbacks.rs, the handler awaits receive_callback, which commits the status change, and then calls state.metrics.record_callback(outcome). A status read that lands between the commit and the counter update sees delivered while the counter is still 0. The single metrics read then fails the check.

The runtime behaviour is fine: the counter is eventually correct, and nothing reads it as a commit signal. The check is too strict about ordering.

Proposed change

Read the applied counter inside the same kind of bounded wait the script already uses for the message status. For example, poll $dev_metrics every 0.5 seconds until the applied count is 1 or settle_seconds passes, then fail with the last value read.

Keep the exact expectation of 1, so a duplicate callback still fails the check.

Verification

  • products/messaging/scripts/test-dev.sh passes locally with Docker.
  • ShellCheck and shfmt -d are clean on the script.
  • Optional: inject a short delay before record_callback in a local build and confirm that the check waits rather than fails.
主要言語
Rust
スター
2
フォーク
0
平均マージ
13時間 7分
マージ済み PR(30日)
119

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

registrystack/registry-stack のほかの issue

registrystack/registry-stack の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。