Fix MaximumFileSizeExceededUploadTest test for PHP 8.3

Created on 22 June 2023, about 1 year ago
Updated 27 June 2023, about 1 year ago

Problem/Motivation

The test FunctionalJavascript/MaximumFileSizeExceededUploadTest started to hang in CI for PHP 8.2 alpha 1 and 2
It was caused by regression https://github.com/php/php-src/issues/11507
Ref #3366843-28: Fix tests broken on PHP 8.3

But the issue in that post_max_size could be hundreds of megabytes and generating such a big file char-by-char could be very time consuming for no reason

Steps to reproduce

check implementation https://git.drupalcode.org/project/drupal/-/blob/11.x/core/tests/Drupal/...

Proposed resolution

- use fseek() as the fastest way to create big file and random generator to get sequence of bytes instead of char by char
- refactor test as it does not require random file as testing controller's behavior, follow-up 📌 Deprecate TestFileCreationTrait::generateFile() Active

Remaining tasks

- discuss
- patch/review/commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

📌 Task
Status

Fixed

Version

10.1

Component
PHPUnit 

Last updated less than a minute ago

Created by

🇫🇷France andypost

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024