- 🇨🇦Canada adriancid Montreal, Canada
Closing because the current development is being made in branch 2.x
NodeRevisionDeleteTest::testGetRelativeTim has a race condition: https://www.drupal.org/pift-ci-job/2420740 → . It's calling strtotime() in the provider (which is executed during test discovery) and the implementation and expect it to return the same. If too much time passes between defining the test and running it (for example when running all tests at once because the functional test then runs first), you get a different result. It's probably less likely to happen on CI as it runs tests one-by one, but it's still possible to have a second-switch in the middle of discovering/running the test as that example shows.
There is no simple fix for this, the only idea I have is passing the current request time from the time service. Then you can mock that and set the same fixed or current request time as an extra test method argument and use the same for the provider and implementation.
FWIW, the whole test is testing fairly little, especially the provider variations. Mostly this is testing strtotime(), it doesn't matter which argumenst are passed in, your code always does exactly the same. So it would also be an option to drop the provider completely. You could also remove the provider, but would still need to set the baseline so that you have a predictable result. within the test module, it's less likely to have a second-switch, but still possible
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Closing because the current development is being made in branch 2.x