-
Notifications
You must be signed in to change notification settings - Fork 264
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
PHPLIB-1531: Replace FailPointObserver with different logic #1427
PHPLIB-1531: Replace FailPointObserver with different logic #1427
Conversation
cfa6c2b
to
63d8d4f
Compare
private function disableFailPoints(array $failPoints): void | ||
{ | ||
foreach ($failPoints as ['failPoint' => $failPoint, 'server' => $server]) { | ||
$operation = new DatabaseCommand('admin', ['configureFailPoint' => $failPoint, 'mode' => 'off']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$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
PHPLIB-1531
FailPointObserver
relies 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 removegetServer
from APM classes.