php / php/php-src

run-tests.php: Add a flag similar to --asan that skips tests when run under Valgrind

Open
#14,805 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category: Tests Feature
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

I just ran 11k tests under Valgrind to try and find issues with one of my big PRs, and any test excepting an OOM failure will either time out or use all the memory before being killed.

It would be great if those could be skipped and not accidentally triggered.

Some relevant tests:

  • ext/standard/tests/gh14643_longname.phpt
  • Zend/tests/bug79836_4.phpt
  • tests/basic/bug67198.phpt (maybe)
  • tests/basic/enable_post_data_reading_05.phpt (maybe)

Other tests are those opening PHP procs and timing out:

  • ext/standard/tests/file/proc_open01.phpt
  • ext/standard/tests/http/gh11274.phpt
  • ext/standard/tests/streams/bug64433.phpt
  • ext/standard/tests/url/get_headers_error_003.phpt

And some tests seem to be bogus with Valgrind or an issue that we cannot fix:

  • ext/standard/tests/mail/mail_basic2.phpt
  • ext/standard/tests/mail/mail_variation2.phpt

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in run-tests.php by reading how the existing --asan flag is parsed and applied. Run the listed .phpt tests under Valgrind to confirm the problematic cases, then verify that the new Valgrind-related flag skips the intended tests without affecting normal test runs.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
testing-qa
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.