test(messaging): wait for the applied callback counter in the dev end-to-end check
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 88/100
Hướng nghiên cứu
Đọc products/messaging/scripts/test-dev.sh và tìm vị trí script kiểm tra metric messaging_provider_callbacks_total{outcome="applied"} sau khi chờ trạng thái SMS. Thăm dò metric định kỳ trong khoảng thời gian chờ có giới hạn hiện có, giữ số lượng mong đợi là 1 và báo giá trị cuối cùng nếu hết thời gian chờ. Chạy script bằng Docker, sau đó kiểm tra bằng ShellCheck và shfmt -d; hoàn tất khi bước kiểm tra chờ bộ đếm và vẫn từ chối các callback trùng lặp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.shpasses locally with Docker.- ShellCheck and
shfmt -dare clean on the script. - Optional: inject a short delay before
record_callbackin a local build and confirm that the check waits rather than fails.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 13 giờ 7 phút
- Pull request đã merge (30 ngày)
- 119
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của registrystack/registry-stack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
registrystack/registry-stack#2924 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
registrystack/registry-stack#2890 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
registrystack/registry-stack#2873 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Give the TypeScript live suite a regular execution pathCó thể đã có người làm @jeremi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
registrystack/registry-stack#2849 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
registrystack/registry-stack#2848 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của registrystack/registry-stack
Issue tương tự
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryĐang mởbug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
getsotto/sotto-authenticator#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
foundry-rs/starknet-foundry#4733 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
-
autofix:working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100