[yast-devel] [PATCH] yast2-core: agent-process: fix stdout/stderr test cases
When running the stdout and stderr test cases while building yast2-core for ARM, we execute processes slower than the yast developer machines apparently :). The test cases expect data to flow between the ycp code and cat within 50 ms, but we can't guarantee that. In fact, it basically never worked in my tests. The real fix would probably to listen on the socket and see if new data comes in and only then read from there, but I'm not sure it's worth it for a test case. Instead, we can just increase the sleeps to something really high so we definitely catch all the shiny new data on the other end of the pipe. Please apply. Signed-off-by: Alexander Graf <agraf@suse.de> --- agent-process/testsuite/tests/stderr.ycp | 8 ++++---- agent-process/testsuite/tests/stdout.ycp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/agent-process/testsuite/tests/stderr.ycp b/agent-process/testsuite/tests/stderr.ycp index 3d420e2..74282aa 100644 --- a/agent-process/testsuite/tests/stderr.ycp +++ b/agent-process/testsuite/tests/stderr.ycp @@ -8,12 +8,12 @@ string out1 = (string)SCR::Read(.read_stderr, id); SCR::Write(., id, "foo\n"); - sleep(50); + sleep(500); // read "foo\n" string out2 = (string)SCR::Read(.read_stderr, id); SCR::Write(., id, "foo2\nfoo2\n"); - sleep(50); + sleep(500); // read "foo2\nfoo2\n" string out3 = (string)SCR::Read(.read_stderr, id); @@ -35,12 +35,12 @@ string out1 = (string)SCR::Read(.read_line_stderr, id); SCR::Write(., id, "foo\n"); - sleep(50); + sleep(500); // read "foo\n" string out2 = (string)SCR::Read(.read_line_stderr, id); SCR::Write(., id, "foo2\nfoo2\n"); - sleep(50); + sleep(500); // read "foo2\n" string out3 = (string)SCR::Read(.read_line_stderr, id); diff --git a/agent-process/testsuite/tests/stdout.ycp b/agent-process/testsuite/tests/stdout.ycp index 86c29fd..f1d0241 100644 --- a/agent-process/testsuite/tests/stdout.ycp +++ b/agent-process/testsuite/tests/stdout.ycp @@ -8,12 +8,12 @@ string out1 = (string)SCR::Read(.read, id); SCR::Write(., id, "foo\n"); - sleep(50); + sleep(500); // read "foo\n" string out2 = (string)SCR::Read(.read, id); SCR::Write(., id, "foo2\nfoo2\n"); - sleep(50); + sleep(500); // read "foo2\nfoo2\n" string out3 = (string)SCR::Read(.read, id); @@ -34,12 +34,12 @@ string out1 = (string)SCR::Read(.read_line, id); SCR::Write(., id, "foo\n"); - sleep(50); + sleep(500); // read "foo\n" string out2 = (string)SCR::Read(.read_line, id); SCR::Write(., id, "foo2\nfoo2\n"); - sleep(50); + sleep(500); // read "foo2\n" string out3 = (string)SCR::Read(.read_line, id); -- 1.6.0.2 -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 11/23/2011 10:06 PM, Alexander Graf wrote:
When running the stdout and stderr test cases while building yast2-core for ARM, we execute processes slower than the yast developer machines apparently :).
The test cases expect data to flow between the ycp code and cat within 50 ms, but we can't guarantee that. In fact, it basically never worked in my tests.
The real fix would probably to listen on the socket and see if new data comes in and only then read from there, but I'm not sure it's worth it for a test case. Instead, we can just increase the sleeps to something really high so we definitely catch all the shiny new data on the other end of the pipe.
What about rather checking for architecture and raise the sleep time only in case of ARM detected (if possible)? I'd prefer not changing it for the rest of architectures. Bye Lukas -- Lukas Ocilka, Appliances Department SUSE LINUX s.r.o., Praha -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Dne Čt 24. listopadu 2011 10:43:41, Lukas Ocilka napsal(a):
On 11/23/2011 10:06 PM, Alexander Graf wrote:
When running the stdout and stderr test cases while building yast2-core for ARM, we execute processes slower than the yast developer machines apparently :).
The test cases expect data to flow between the ycp code and cat within 50 ms, but we can't guarantee that. In fact, it basically never worked in my tests.
The real fix would probably to listen on the socket and see if new data comes in and only then read from there, but I'm not sure it's worth it for a test case. Instead, we can just increase the sleeps to something really high so we definitely catch all the shiny new data on the other end of the pipe.
What about rather checking for architecture and raise the sleep time only in case of ARM detected (if possible)? I'd prefer not changing it for the rest of architectures.
Even the .probe-agent in YaST knows the arm architecture. But I'm not sure if we can avoid faking the architecture and use the real architecture in the testsuite. Jiri -- Regards, Jiri Srain Project Manager --------------------------------------------------------------------- SUSE LINUX, s.r.o. e-mail: jsrain@suse.cz Lihovarska 1060/12 tel: +420 284 084 659 190 00 Praha 9 fax: +420 284 084 001 Czech Republic http://www.suse.cz -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Dne 24.11.2011 10:43, Lukas Ocilka napsal(a):
What about rather checking for architecture and raise the sleep time only in case of ARM detected (if possible)? I'd prefer not changing it for the rest of architectures.
Well, Arch.ycp does not support ARM, we would need to extend the arch detection, maybe fix also hwinfo. Anyway, I'll fix it in the proper way - loop until there is an output available, it will be architecture independent and work even on slow systems. -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 24.11.2011, at 11:21, Ladislav Slezak <lslezak@suse.cz> wrote:
Dne 24.11.2011 10:43, Lukas Ocilka napsal(a):
What about rather checking for architecture and raise the sleep time only in case of ARM detected (if possible)? I'd prefer not changing it for the rest of architectures.
Well, Arch.ycp does not support ARM, we would need to extend the arch detection, maybe fix also hwinfo.
Anyway, I'll fix it in the proper way - loop until there is an output available, it will be architecture independent and work even on slow systems.
Thanks. That's probably the best way forward, yes :). This bug really has nothing to do with arm - the way we build arm packages today just happens to be slow enough for us to hit the bug. But it could hit us just the same anywhere else. Alex
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 24.11.2011, at 11:21, Ladislav Slezak wrote:
Dne 24.11.2011 10:43, Lukas Ocilka napsal(a):
What about rather checking for architecture and raise the sleep time only in case of ARM detected (if possible)? I'd prefer not changing it for the rest of architectures.
Well, Arch.ycp does not support ARM, we would need to extend the arch detection, maybe fix also hwinfo.
Anyway, I'll fix it in the proper way - loop until there is an output available, it will be architecture independent and work even on slow systems.
So how is this going along? I'd really like to see yast2-core build successfully in openSUSE:Factory:ARM. Alex -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Dne 2.12.2011 01:52, Alexander Graf napsal(a):
On 24.11.2011, at 11:21, Ladislav Slezak wrote:
Dne 24.11.2011 10:43, Lukas Ocilka napsal(a):
What about rather checking for architecture and raise the sleep time only in case of ARM detected (if possible)? I'd prefer not changing it for the rest of architectures.
Well, Arch.ycp does not support ARM, we would need to extend the arch detection, maybe fix also hwinfo.
Anyway, I'll fix it in the proper way - loop until there is an output available, it will be architecture independent and work even on slow systems.
So how is this going along? I'd really like to see yast2-core build successfully in openSUSE:Factory:ARM.
Sorry, I had some other work (SP2 online migration), I'll look at it ASAP. -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Dne 2.12.2011 10:09, Ladislav Slezak napsal(a):
Dne 2.12.2011 01:52, Alexander Graf napsal(a): [...]
So how is this going along? I'd really like to see yast2-core build successfully in openSUSE:Factory:ARM.
Sorry, I had some other work (SP2 online migration), I'll look at it ASAP.
Fixed in yast2-core-2.22.0 (YaST:Head in OBS), created SR#94998 to openSUSE:Factory. -- Ladislav Slezák Appliance department / YaST Developer Lihovarská 1060/12 190 00 Prague 9 / Czech Republic tel: +420 284 028 960 lslezak@suse.com SUSE -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
On 02.12.2011, at 13:34, Ladislav Slezak wrote:
Dne 2.12.2011 10:09, Ladislav Slezak napsal(a):
Dne 2.12.2011 01:52, Alexander Graf napsal(a): [...]
So how is this going along? I'd really like to see yast2-core build successfully in openSUSE:Factory:ARM.
Sorry, I had some other work (SP2 online migration), I'll look at it ASAP.
Fixed in yast2-core-2.22.0 (YaST:Head in OBS), created SR#94998 to openSUSE:Factory.
Awesome! Thank you :) Alex -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
participants (4)
-
Alexander Graf
-
Jiri Srain
-
Ladislav Slezak
-
Lukas Ocilka