Skip to content

test(pubsub): add more publisher actor tests#4581

Open
PhongChuong wants to merge 3 commits intogoogleapis:mainfrom
PhongChuong:pubsubActorTests
Open

test(pubsub): add more publisher actor tests#4581
PhongChuong wants to merge 3 commits intogoogleapis:mainfrom
PhongChuong:pubsubActorTests

Conversation

@PhongChuong
Copy link
Collaborator

No description provided.

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Feb 5, 2026
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.02%. Comparing base (2259157) to head (1c3784a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4581   +/-   ##
=======================================
  Coverage   95.02%   95.02%           
=======================================
  Files         195      195           
  Lines        7456     7456           
=======================================
  Hits         7085     7085           
  Misses        371      371           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PhongChuong PhongChuong marked this pull request as ready for review February 5, 2026 18:21
@PhongChuong PhongChuong requested a review from a team as a code owner February 5, 2026 18:21
.withf(|req, _o| req.topic == TOPIC)
.times(5)
.returning({
|r, o| {
Copy link
Member

Choose a reason for hiding this comment

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

optional: This test doesn't really verify that the order the messages go in is the order they show up in the requests.

You could send the requests out on an unbounded_channel...

ack_tx
.send(r.into_inner())
.expect("sending on channel always succeeds");

and verify the requests contained [m1, m2], [m3, m4], ... , [m9, m10] at the end of the test:

// Verify the acks went through.
let ack_req = ack_rx.try_recv()?;
assert_eq!(ack_req.subscription, "projects/p/subscriptions/s");
assert_eq!(sorted(ack_req.ack_ids), test_ids(1..7));

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. Let me think about how to do this cleanly for all sequential actor tests and add it in a future PR.

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

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants