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

test(NODE-5265): fix flaky operation count test #3688

Merged
merged 1 commit into from
May 30, 2023
Merged

Conversation

durran
Copy link
Member

@durran durran commented May 26, 2023

Description

Fixes operation count flaky test.

What is changing?

Wraps the increment/decrement of the server's operation count in 2 methods, that then can be spied on to assert the number of times each was called.

Is there new documentation needed for these changes?

None

What is the motivation for this change?

NODE-5265

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@durran durran changed the title test(NODE-5265): fix operation count test test(NODE-5265): fix flaky operation count test May 26, 2023
@durran durran marked this pull request as ready for review May 26, 2023 17:37
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

one question, just requesting changes for visibility.

Comment on lines +427 to +436
private decrementOperationCount(): number {
return (this.s.operationCount -= 1);
}

/**
* Increment the operation count, returning the new count.
*/
private incrementOperationCount(): number {
return (this.s.operationCount += 1);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to return the new count, if we're not chaining it or using the returned value?

Copy link
Member Author

Choose a reason for hiding this comment

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

No was just a general practice I like to use - if the method would normally be void try potentially returning something useful if possible.

@baileympearson baileympearson self-assigned this May 30, 2023
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label May 30, 2023
@baileympearson baileympearson merged commit 1e58a4c into main May 30, 2023
@baileympearson baileympearson deleted the NODE-5265 branch May 30, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
2 participants