Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the runtime mocks to support batches and rebasing #16460

Merged
merged 16 commits into from
Jul 25, 2023

Conversation

andre4i
Copy link
Contributor

@andre4i andre4i commented Jul 19, 2023

Description

Adding a mock to support the new states added with #16176. This will be further integrated into the test pipeline via the fuzz testing harness.

Another (arguably better) approach to #16163

@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: sharedstring area: runtime Runtime related issues public api change Changes to a public API base: main PRs targeted against main branch labels Jul 19, 2023
@andre4i andre4i marked this pull request as ready for review July 20, 2023 17:00
@andre4i andre4i requested review from a team as code owners July 20, 2023 17:00
@andre4i andre4i requested a review from vladsud July 20, 2023 17:01
@andre4i andre4i changed the title Change the runtime mocks to support batches and rebasing - EXPERIMENTAL Change the runtime mocks to support batches and rebasing Jul 20, 2023
* If flush mode is set to FlushMode.TurnBased, it will send all messages queued since the last time
* this method was called. Otherwise, calling the method does nothing.
*/
public flush?() {
Copy link
Contributor Author

@andre4i andre4i Jul 20, 2023

Choose a reason for hiding this comment

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

The reason for these methods to be optional is because of back-compat. Making them required will break forward compatibility and we'd have to be explicit about it in package.json, which is not something we like to do in main. After merging, a corresponding PR will be made to next which will have these methods appropriately declared and also, we'll get rid of all the other asserts in the code related to this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that when it comes to interface definition. But I'm not sure what "?" helps with here. It basically says that MockContainerRuntime and derived classes could overwrite this property to be empty. Is this what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I follow, @vladsud. Which interface? This class is exported as-is in the public API. Clients are taking a dependency is on the class, take a look at index.ts. If this method is not optional, we'll technically break forward-compat and we'd need the

"ClassDeclaration_MockContainerRuntimeForReconnection": {"forwardCompat": false}
"ClassDeclaration_MockContainerRuntime": {"forwardCompat": false}

in package.json. Not a big deal but also, it's something we try not to do in main if we can help it.

Do you have an alternative in mind?

@andre4i andre4i requested a review from Abe27342 July 21, 2023 17:54
@andre4i andre4i requested a review from Abe27342 July 21, 2023 19:56
@andre4i andre4i merged commit add4cd7 into microsoft:main Jul 25, 2023
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: sharedstring area: dds Issues related to distributed data structures area: runtime Runtime related issues base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants