Opened 10 years ago
Closed 10 years ago
#31994 closed defect (bug) (fixed)
WP should not autodetect pretty permalinks during unit test installation
Reported by: | boonebgorges | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
The new-in-4.2 wp_install_maybe_enable_pretty_permalinks()
, called from wp_install()
, works by sending a couple of remote requests to a dummy URL. The 5-second timeout for each of these checks is negligible during a normal installation. But adding ten seconds to the process of running phpunit
is pretty crippling for dev work - especially since our unit tests assume that pretty permalinks are disabled by default.
The attached patch is a suggested fix that doesn't require touching /src/
. Not sure if it's kosher to slip this in for 4.2.
Attachments (1)
Change History (7)
#2
@
10 years ago
- Keywords commit added
This looks like a quality change to me as well and worthy of going into trunk.
#3
follow-up:
↓ 5
@
10 years ago
- Keywords commit removed
Seems sensible, however I ran a total of eight test runs, four times each before and after the patch and based on my small sample, it actually ran slower with this change, though negligible.
Before patch:
1: 2.59 min
2: 2.52 min
3: 2.54 min
4: 2.62 min
Average: 2.56 min
After:
1: 2.57 min
2: 2.74 min
3: 2.77 min
4: 2.61 min
Average: 2.67 min
#5
in reply to:
↑ 3
@
10 years ago
Replying to DrewAPicture:
Seems sensible, however I ran a total of eight test runs, four times each before and after the patch and based on my small sample, it actually ran slower with this change, though negligible.
Yeah, those numbers are not significant. A bit more detail about the problem: wp_install_maybe_enable_pretty_permalinks()
tries to ping your own domain. On the default test setup, that means 'example.org/2015/04/16/hello-world' or something like that. I was running into this problem because I was on a slow internet connection, which meant that example.org
DNS lookups were timing out. If you don't have a lousy internet connection handy, you can reproduce the problem by finding a domain name that responds very slowly to pings, and using it as your 'WP_TESTS_DOMAIN'
.
I'm fine with this happening in trunk now, related to 4.2 but essentially separate.