Skip to content

Commit b8d91bc

Browse files
Kendall Hopkinsfacebook-github-bot
authored andcommitted
Delay PZ2FlowsToLogging until PSP to avoid dependently computing the core annotation
Summary: We need to avoid hitting a cycle due to computing the core annotation when the fast path passes, but we also want to log the core annotation every time. To break this loop, let's delay the logging to PSP. Reviewed By: andrewvaslas Differential Revision: D73955994 fbshipit-source-id: ba508f5833496875eb408be6b55059b056f7a5cb
1 parent e5abf8a commit b8d91bc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

third-party/thrift/src/thrift/lib/hack/src/__tests__/ThriftPolicyEnforcerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ public function testTrustedCallersBitmask(): void {
398398
)
399399
->build(),
400400
);
401+
await PSP()->genRunFromUnitTest(); // flush logs
401402
expect($mock)->wasCalledWithArgumentsPassingNTimes(
402403
($_event, $_sample_rate, $specific_meta) ==> {
403404
return $specific_meta['thrift_caller_service_id'] === 'foo/bar';
@@ -425,6 +426,7 @@ public function testTrustedCallersBitmask(): void {
425426
)
426427
)->genBefore('fake_service', 'fake_method');
427428

429+
await PSP()->genRunFromUnitTest(); // flush logs
428430
expect($mock)->wasCalledWithArgumentsPassingNTimes(
429431
($_event, $_sample_rate, $specific_meta) ==> {
430432
return $specific_meta['thrift_caller_service_id'] === 'sr_config_1';
@@ -456,6 +458,7 @@ public function testTrustedCallersBitmask(): void {
456458
)
457459
)->genBefore('fake_service', 'fake_method');
458460

461+
await PSP()->genRunFromUnitTest(); // flush logs
459462
expect($mock)->wasCalledWithArgumentsPassingNTimes(
460463
($log, $_sample_rate) ==> {
461464
return Shapes::idx($log, 'client_id') === $client_id;

0 commit comments

Comments
 (0)