Opened 6 weeks ago
Last modified 2 weeks ago
#62110 new defect (bug)
AtomParser_Parse_Test::test_parse_sets_handlers failing
Reported by: | benniledl | Owned by: | |
---|---|---|---|
Milestone: | 6.7.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
Hello,
this test was recently added and is failing for some reason.
Adding the debug flag public $debug = true; does not give a more detailed error message.
Changing the failing assertion so that it passes, reveals that the next assertions in this test also fail.
AtomParser_Parse_Test::test_parse_sets_handlers end_ns() handler did not get called expected nr of times Failed asserting that 2 is identical to 0. /var/home/servertechnik_com/wp-tests/wp-env/tests/phpunit/tests/atomlib/AtomParser_Parse_Test.php:71 ---- AtomParser_Parse_Test::test_parse_sets_handlers cdata() handler did not get called expected nr of times Failed asserting that 97 is identical to 57. /var/home/servertechnik_com/wp-tests/wp-env/tests/phpunit/tests/atomlib/AtomParser_Parse_Test.php:72 ---- AtomParser_Parse_Test::test_parse_sets_handlers _default() handler did not get called expected nr of times Failed asserting that 7 is identical to 2. /var/home/servertechnik_com/wp-tests/wp-env/tests/phpunit/tests/atomlib/AtomParser_Parse_Test.php:73
https://make.wordpress.org/hosting/test-results/r59073/
Domaintechnik
Failed PHP 8.3.11 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Failed PHP 8.2.23 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Failed PHP 8.1.29 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Failed PHP 8.0.30 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Failed PHP 7.4.33 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Failed PHP 7.3.33 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Failed PHP 7.2.34 mysql Ver 8.0.36-2 for Linux on x86_64 ((Debian))
Change History (9)
#1
@
6 weeks ago
- Component changed from External Libraries to Build/Test Tools
- Milestone changed from Awaiting Review to 6.7
#2
@
6 weeks ago
The tests also fail for me locally when run in isolation, with a slightly different message though:
phpunit --filter AtomParser_Parse_Test ... There was 1 failure: 1) AtomParser_Parse_Test::test_parse_sets_handlers cdata() handler did not get called expected nr of times Failed asserting that 60 is identical to 57. S:\home\wordpress.test\develop-trunk\tests\phpunit\tests\atomlib\AtomParser_Parse_Test.php:72
#3
follow-up:
↓ 4
@
6 weeks ago
Hey @SergeyBiryukov,
I tried to run the command phpunit --filter AtomParser_Parse_Test
on trunk.However I got no failure, am I missing something?
#4
in reply to:
↑ 3
@
6 weeks ago
Replying to coquardcyr:
I tried to run the command
phpunit --filter AtomParser_Parse_Test
on trunk.However I got no failure, am I missing something?
It passes for me on Ubuntu, but fails on Windows. This could use some more investigation.
#5
@
5 weeks ago
For the record: I created the test while running on Windows and now they are committed, they still pass for me on Windows too.
A brainfart just made think of line ending differences though, so I just to did a test run converting the fixture file line endings to CRLF and hey, presto, I can see the test failing, but just and only on the $atom->cdata_call_counter
related assertion.
Changing that assertion to something like $this->assertGreaterThan( 56, $atom->cdata_call_counter, sprintf( $msg, 'cdata' ) );
makes it pass again for me and makes the complete test pass again too.
@benniledl @SergeyBiryukov Could you both check how you do your git check-out on Windows ? If you both use core.autocrlf = true
instead of core.autocrlf = input
, that would explain at least that difference.
Still doesn't explain the other differences though.
Having said that, it does confirm that - at least for this part - this is a pre-existing issue, which just never was discovered because there were no tests covering the code.
I imagine we may be able to do some line ending normalization before parsing the feed (or during). Then again, if the handlers deal with "empty" nodes correctly, we could also treat this as a test-only issue and change the relevant assertions from assertSame()
to assertGreaterThan()
as - after all - this test is just about verifying that the handlers get called, not about testing the functionality of the handlers.
But before we take any decision, I think it would be good to discover the underlying cause for the other failing tests, so let's start with checking the core.autocrlf
setting and verifying that if that is set to input
while on Windows, the tests pass. If they still don't pass, we need to dig deeper.
#6
@
5 weeks ago
I have checked, autocrlf is not set for me. But now that you say that reminds me, I have had a few issues with line ending characters in the past.
I tried setting core.autocrlf to input and running the test but it didnt change anything. I'm on Debian btw.
#7
@
5 weeks ago
Tests are still failing for me on php 8.3 - 7.4, they are now passing on 7.3 and 7.2, I have not changed anything on the environment besides now using the new multi php phpunit-test-runner
https://make.wordpress.org/hosting/test-results/r59156/
#8
@
2 weeks ago
- Keywords reporter-feedback added
- Milestone changed from 6.7 to 6.7.1
Hi @benniledl,
I am moving this to 6.7.1 to continue investigating.
I noticed that you're no longer reporting to the Host Tests, likely because you were just continuing to report failures. Could you confirm that you're still experiencing the issue?
@benniledl tests are failing after the introduction of this new
AtomParser_Parse_Test
test via [59062] / #62061. Moving this ticket into 6.7 for investigation.I asked them to rollback the changes in the source code and rerun the tests:
So the issue is not due to the changes made in
AtomParser::parse()
. Marking this ticket then as Build/Test, as it seems to specific the tests and/or test's xml data.Sharing more of Benni's debug findings: