Skip to content

Conversation

obenland
Copy link
Member

@obenland obenland commented Oct 2, 2025

When I first saw the @runInSeparateProcess in I thought it was a neat way to solve the defined constants problem. It does however come at a pretty big speed penalty. Let's avoid using it when we can.

Slow Tests (>= 0.2s):
  1.228s Activitypub\Tests\Integration\Test_Jetpack::test_init_skips_sync_hooks_on_wpcom
  1.210s Activitypub\Tests\Model\Test_Blog::test___construct
  1.061s Activitypub\Tests\Integration\Test_Jetpack::test_add_reader_link with data set "pending following should not have reader link"
  0.897s Activitypub\Tests\Integration\Test_Jetpack::test_add_reader_link with data set "active following with feed ID"
  0.864s Activitypub\Tests\Integration\Test_Jetpack::test_add_reader_link with data set "active following without feed ID"

From https://github.com/Automattic/wordpress-activitypub/actions/runs/18201146182/job/51820087608

Proposed changes:

  • Removes runInSeparateProcess annotations and reorders tests to continue to work.

Other information:

  • Have you written new tests for your changes, if applicable?

@obenland obenland requested a review from pfefferle October 2, 2025 18:30
@obenland obenland self-assigned this Oct 2, 2025
@obenland obenland added the Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary. label Oct 2, 2025
@Copilot Copilot AI review requested due to automatic review settings October 2, 2025 18:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes @runInSeparateProcess annotations from PHPUnit tests to improve test execution speed, as separate processes incur significant performance overhead. The change restructures test organization while maintaining test functionality.

  • Removes @runInSeparateProcess and @preserveGlobalState disabled annotations from two test methods
  • Reorders test methods to ensure proper execution flow without separate processes
  • Consolidates test logic while preserving all original test coverage
Comments suppressed due to low confidence (1)

tests/integration/class-test-jetpack.php:1

  • The test data provider cases have been reordered, changing the execution order from 'with feed ID' first to 'without feed ID' first. This reordering should be intentional and documented, or the original order should be preserved to maintain consistency with existing test expectations.
<?php

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@obenland obenland merged commit 901bc9c into trunk Oct 3, 2025
13 checks passed
@obenland obenland deleted the update/jetpack-tests branch October 3, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Disables the "Changelog Updated" action for PRs where changelog entries are not necessary.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants