Page MenuHomePhabricator

[services] Tests - Add send log
ClosedPublic

Authored by karol on May 31 2022, 6:50 AM.
Tags
None
Referenced Files
F3492157: D4166.id13461.diff
Wed, Dec 18, 10:19 PM
F3492099: D4166.id13396.diff
Wed, Dec 18, 10:10 PM
Unknown Object (File)
Wed, Dec 4, 5:29 AM
Unknown Object (File)
Tue, Dec 3, 10:25 PM
Unknown Object (File)
Nov 17 2024, 2:42 PM
Unknown Object (File)
Nov 17 2024, 12:47 PM
Unknown Object (File)
Nov 17 2024, 12:37 PM
Unknown Object (File)
Nov 14 2024, 10:26 AM

Details

Summary

Depends on D4165

Adding a script for sending log.

Test Plan

This, for now, doesn't do anything.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.May 31 2022, 6:57 AM
Harbormaster failed remote builds in B9545: Diff 13239!
karol edited the test plan for this revision. (Show Details)
karol added reviewers: ashoat, tomek, varun.
karol edited the test plan for this revision. (Show Details)

CI

Harbormaster returned this revision to the author for changes because remote builds failed.May 31 2022, 7:24 AM
Harbormaster failed remote builds in B9552: Diff 13246!
Harbormaster returned this revision to the author for changes because remote builds failed.May 31 2022, 7:28 AM
Harbormaster failed remote builds in B9557: Diff 13251!

I know that Ci failed but it's related to docker which I know is not working properly right now.

services/commtest/src/send_log.rs
13–14 ↗(On Diff #13251)

Hacked it like this but I feel like this isn't a good solution.

I don't feel confident enough to review Rust :(

tomek requested changes to this revision.Jun 1 2022, 6:43 AM
tomek added inline comments.
services/commtest/src/send_log.rs
13–14 ↗(On Diff #13251)

Maybe String::from or .clone() can be used?

16 ↗(On Diff #13251)

Do we need a loop that does only one iteration?

This revision now requires changes to proceed.Jun 1 2022, 6:43 AM
tomek requested changes to this revision.Jun 8 2022, 5:55 AM
tomek added inline comments.
services/commtest/src/send_log.rs
32 ↗(On Diff #13396)

Are these magic numbers meaningful?

45 ↗(On Diff #13396)

How does this work? Does this send requests from a stream one by one?

This revision now requires changes to proceed.Jun 8 2022, 5:55 AM
services/commtest/src/send_log.rs
32 ↗(On Diff #13396)

No, just random

45 ↗(On Diff #13396)

so this takes the outbound that seems to be a generator and uses yield to send the following requests to the server. I think generators in rust are about to be similar to the ones in Python. So they lazily evaluate the results of a function. However, it seems that they're not fully implemented in rust yet: https://doc.rust-lang.org/beta/unstable-book/language-features/generators.html

tomek added inline comments.
services/commtest/src/send_log.rs
45 ↗(On Diff #13396)

And what about the return value? We have only a single value, response, but multiple requests (from a stream). Is it a return value of the last request?

And about the stability of generators: according to the unstable book, the are really experimental. But we probably didn't need to set any flag to access the feature, so maybe the book is outdated? Could you check if they can be used safely? (it wouldn't be great if the API changed with the next rust version).

varun requested changes to this revision.Jun 13 2022, 4:42 AM

weren't we thinking about reorganizing these as individually executed tests instead of a bunch of functions run from main?

This revision now requires changes to proceed.Jun 13 2022, 4:42 AM
karol retitled this revision from [DRAFT] [services] Tests - Add send log to [services] Tests - Add send log.Jun 13 2022, 6:42 AM
This revision is now accepted and ready to land.Jun 15 2022, 11:47 AM
This revision was automatically updated to reflect the committed changes.