PHPLIB-1531: Replace FailPointObserver with different logic#1427
Merged
jmikola merged 3 commits intomongodb:v1.20from Sep 20, 2024
Merged
PHPLIB-1531: Replace FailPointObserver with different logic#1427jmikola merged 3 commits intomongodb:v1.20from
jmikola merged 3 commits intomongodb:v1.20from
Conversation
cfa6c2b to
63d8d4f
Compare
GromNaN
reviewed
Sep 19, 2024
jmikola
reviewed
Sep 20, 2024
| private function disableFailPoints(array $failPoints): void | ||
| { | ||
| foreach ($failPoints as ['failPoint' => $failPoint, 'server' => $server]) { | ||
| $operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint, 'mode' => 'off']); |
Contributor
There was a problem hiding this comment.
Suggested change
| $operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint, 'mode' => 'off']); | |
| $operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint->configureFailPoint, 'mode' => 'off']); |
@alcaeus: This should resolve the runtime error you encountered.
That said, I came up with another PR that consolidates this logic into a ManagesFailPointsTrait, which is closer to what we had with FailPointObserver. These files are already quite complex, so I wanted to minimize additional clutter. I'll defer to you, though.
See: alcaeus#1
jmikola
approved these changes
Sep 20, 2024
This was referenced Sep 20, 2024
Merged
Merged
This was referenced Sep 23, 2024
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PHPLIB-1531
FailPointObserverrelies on APM events exposing a server instance to record servers with enabled fail points. Since the method is deprecated, the context will now store all fail points created during the execution of a test, and the test runner will disable all fail points recorded in the context. This will achieve the same effect while allowing us to removegetServerfrom APM classes.