Skip to content

Add miliseconds do the test time output #12729

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

Merged
merged 4 commits into from
Dec 29, 2023

Conversation

jorgsowa
Copy link
Contributor

This PR adds the fractional part (3 digits) of the time taken by tests to the test output.

@jorgsowa jorgsowa changed the title add miliseconds do the test time output Add miliseconds do the test time output Nov 19, 2023
@kamil-tekiela
Copy link
Member

This doesn't seem to work properly:

Deprecated: Implicit conversion from float 725.557475467 to int loses precision in /home/runner/work/php-src/php-src/run-tests.php on line 3225
TIME START 1970-01-01 00:12:05

@jorgsowa jorgsowa force-pushed the add-miliseconds-to-test-output branch from 65d36d4 to 25c8ac4 Compare December 22, 2023 23:00
@jorgsowa jorgsowa force-pushed the add-miliseconds-to-test-output branch from 816bad9 to ae56a49 Compare December 28, 2023 11:48
@Girgias Girgias merged commit 948b2bc into php:master Dec 29, 2023
@iluuu1994
Copy link
Member

@iluuu1994
Copy link
Member

TBH this change seems questionable. What are we actually measuring here? For short tests, the actual test execution time will be dwarfed by the creation of potentially multiple processes (skipif, test, cleanup) and PHP startup. For longer tests, milliseconds aren't meaningful.

@jorgsowa
Copy link
Contributor Author

jorgsowa commented Jan 1, 2024

Sorry for breaking. I have pushed the fix for this issue: #13064

The reason for the change was that we run short tests we get the output 0 seconds what is misleading and for some developers it may indicate that the script is broken. I wanted to change this impression.

If you think this doesn't bring any value I'm fine with reverting changes by myself or anyone else.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

If confusion is an actual problem, a simple fix might've been making the script say "<1 seconds".

Note that a completely empty test (<?php ?>) still takes 0.024 seconds on my machine. As such, milliseconds don't seem useful. Anyway, I don't care too much because that number is mostly irrelevant to me. It's just obviously important that 32-bit continues working.

{
echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $end_time) . "\n";
echo "=====================================================================\nTIME END " . date('Y-m-d H:i:s', $start_timestamp + (int)(($end_time - $start_time)/1e9)) . "\n";
Copy link
Member

@iluuu1994 iluuu1994 Jan 1, 2024

Choose a reason for hiding this comment

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

This does not look correct. $start_timestamp is rounded down. The end time can still be $start_timestamp + 1, even if ($end_time - $start_time) < 1. I don't understand why this was changed at all.

@jorgsowa jorgsowa deleted the add-miliseconds-to-test-output branch February 8, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants