Comments (11)
from tester.
It should be cross-platform solution
On what platform it does not work?
from tester.
No way! It works for Windows too! 😃 Well, I'm shut up. I don't see a reason why not to do that in this way.
from tester.
Sent pull request #89
from tester.
We were discussing it with @dg and we agreed that stderr should be captured by Job separately. I tried to implement it, but there is really a lot of proc_open()'s bugs espacially on Win.
The main problem is with stderr as pipe and large output. Bugs #65650, #51800, #64438, #60120. For some I found workaround, but for some not on PHP 5.3.3. The bug behavior is that the process get stuck when reading even single byte from stdout or stderr.
One solution is use php://temp
for stderr, but it is not the way since temp file is opened and discarted with every Job. But it works.
Next solution is use it and just pray for stderr shorter 2048 bytes ;-)
The safest way is close the stderr immediately after proc_open() as it is done now.
The next is use proposed 2>&1
, mix the stdout with stderr and somehow parse valid HTTP headers.
I have no more ideas...
from tester.
Btw. @MartinMystikJonas When is the stderr hidden? If I use file_put_contents('php://stderr', 'test');
in tests now, I get E_WARNING: file_put_contents(): Only 0 of 4 bytes written, possibly out of free disk space
because stderr is closed.
from tester.
@milo Did you manage to solve this issus on Windows or did you give up?
I have one idea how to solve this. It's not strictly clean but if we need workaround bug I think it is acceptable.
My idea is to output stderr to custom temp file (similarly to lock file used in Environment::lock
) and then just read this file.
What do you think? Could this solution work?
from tester.
@MartinMystikJonas I didn't solve this, din't give up yet.
My idea is to output stderr to custom temp file
That's I wrote above with the php://temp
. Problem is, this temporary file is created by every job, even stderr is not used.
Maybe solution is just mix stdin and stdout together as proposed. Who cares about wrong HTTP headers parsing. If is header needed by test, it just fails.
from tester.
Well what about use just 2> stderr-uniqid
? File will be created only if there is some output
from tester.
@MartinMystikJonas Not so on Linux. But interesting idea...
from tester.
@milo My bad. I did not try it :-)
from tester.
Related Issues (20)
- Dumper bug in version 1.7.1 HOT 8
- Teamcity native support HOT 6
- FileMock test fails in PHP 7.3.0beta3 HOT 1
- Missing response code assertion HOT 2
- Class 'SimpleXMLElement' not found
- bypassFinals: touch() expects parameter 2 to be integer, null given
- bypassFinals: breaks file locking HOT 1
- E_USER_WARNING: File's modification time is in the future. Cannot update it: touch(): Tester\FileMock::stream_metadata is not implemented! HOT 4
- Support for minor distinction of exceptions HOT 3
- Annotation like @accessPrivateMethod HOT 3
- Add warning about wrong regex form in Assert::match() in tester output HOT 1
- PHP 7.4 support HOT 4
- Runner: Waiting for last async Job causes high CPU usage HOT 1
- Wrong usage of ANSI terminal colors HOT 2
- dataProvider & Tester\DataProvider::testQuery() must be of the type string
- fwrite to php://stderr throws E_NOTICE on php 7.4 HOT 21
- Export coverage to Cobertura xml format HOT 1
- `\Tester\TestCase::tearDown` is not executed on php crash HOT 3
- Tracking deprecations HOT 6
- Assert::type should accept native type names "boolean" and "double" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tester.