Detect test results more accurately when generating HTML
Hi,
Quoted 11 lines · rohit verma
Hi,
This would be a tedious task. If you look into
ltp/pan/pan.c, you can find that the parent process is writing the tags (<<<test_start>>>, <<<test_output>>>, etc...) and the child process goes on to execute the testcase using exec system call. Once the child has invoked the testcase through exec, the pan does not have any control on flushing the output. If flushing is important then it has to be taken up in each of the testcases.
Quoted 6 lines
If you look at few of the outputs, you can find that the test output is appearing before the <<<
test_start>>> or in between <<<test_start>>> and <<<test_output>>>, which implies that before the parent has written the headers, the child executes and writes its output to stdout. I don't know if adding delay in child will solve the problem.
How much would you want to delay ? May be to some microsecs !! However delaying is not a good option, but, i am ready to consider. See, what is the reasanable time so that this problem vanishes.
Meanwhile, i have generated this small patch. It tries to flush all data to be written to STDOUT before the Parent (PAN) tries to write his next tag. Moreover, i have included the fflush() to be executed inside the if()��s domain whenever the parent is writing from <<test_start>> till <<test_output>>. See, if this can help in solving the problem.
---
pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +3 -2
@@ -1015,6 +1015,7 @@ static pid_t run_child(struct coll_entry errbuf[errlen] ='\0' ;/* fprintf(stderr, "%s", errbuf); */ waitpid (cpid, &status,0 ); +fflush (stdout);/* Flush any data before writing <<test_end>>*/ if (WIFSIGNALED (status)) { termid =WTERMSIG (status); termtype ="signaled" ;
@@ -1300,14 +1301,14 @@ static void copy_buffered_output(structstatic void write_test_start (struct tag_pgrp *running,const char *init_status) { -if (!strcmp (reporttype,"rts" )) +if (!strcmp (reporttype,"rts" )) {printf ("%s\ntag=%s stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\ninitiation_status=\"%s\"\n%s\n" ,"<<<test_start>>>" , running->cmd->name, running->mystime, running->cmd->cmdline,"" ,"exit" , init_status,"<<<test_output>>>" ); -fflush (stdout); + } }
---
Regards--
Subrata
Quoted 231 lines
Let me know your views on the same.
Regards,
RohitQuoted 221 lines · Subrata Modak
Quoted 7 lines · rohit verma
Hi,
There is no problem with the genhtml.pl script. The real problem is in the pan driver (
ltp/pan/pan.c). This seems to be a problem of race condition after going through the code.I would rather want to get this guy fixed inside
pan.c. See, if there is a way so that the concerned test is provisioned by pan:1) Only after <<
test_output>>
2) Pan must flush out everything for writing tags before the actual test is provisioned
3) The test must have written/flushed everything before Pan started writing <<test_end>>Regards--
SubrataQuoted 200 lines
My suggestion was to use the buffered mode as default. This can be done with the -O option followed by a directory name where the buffered data can be stored. But, there is a problem - the -O option has no effect unless the -x option with an argument greater than 1 is used.
In your test runs you can add the options " -O <dirname> -x 2" and find out if the problem with logging still persists.
Regards,
rohitOn Fri, May 22, 2009 at 2:43 PM, Marc Gauthier <[email protected]> wrote:
Hi Rohit,I guess we've each observed output that the other has not :-)
Per your (1): I've seen a few cases where lines between
test_endandtest_startdo belong to the preceding one, though they are indeed the exception, not the rule. Looking at the name to assign to previous seems to catch the proper ones in all the cases I've seen (default test lists don't repeat the same test twice in a row).Per your (2): Haven't seen that, interesting. That's a bit harder to sort out, but the script could at least catch the lines that report PASS/FAIL/BROK etc. And perhaps lines that don't look like a collection of var=value. Hmmm.... maybe all it needs is another regexp test, see patch below (against the genhtml.pl file I posted, which btw was against its latest version, 1.3).
I haven't taken time to look at why things get out of order in the first place, which seems like the correct thing to fix (well, I looked enough to notice that fflush(stdout) was really there :-). Though making the script handle it doesn't hurt, and I've simply been trying to get an accurate look at test results, this was the quickest way to do it.
-Marc
--- genhtml-v4.pl 2009-05-21 01:08:14.747493000 -0700
+++ genhtml.pl 2009-05-22 02:07:47.756226000 -0700 @@ -116,18 +116,18 @@
}# Read test result parameters and test output
- while ($line !~ /$end_tag/) {
+ while (1) {
+get_line(\$line)or last TEST;
+ last if $line =~ /$end_tag/;
($read_output = 1, next) if $line
=~ /$output_tag/;
($read_output = 0, next) if $line
=~ /$execution_tag/;
- if ($read_output) {
+ if ($read_output or $line !~ /^(\s*\w
+=(".*"|\S*))+\s*$/) {
push @output_lines, $line;
} else {
while ($line =~ s/^\s*(\w+)=(".*"|
\S*)//) {
$values{$1} = $2;
}
}
- } continue {
-get_line(\$line)or last TEST;
}# Treat lines that follow <<<
end_test>>> as
output lines______________________________________________________
From: rohit verma [mailto:[email protected]]
Sent: Friday, May 22, 2009 00:13
To: [email protected]
Cc: Marc Gauthier; LTP List
Subject: Re: [LTP] [PATCH] Detect test results more accurately when generating HTMLHi,
The suggestion to - "Process test output lines that appear between <<<
test_end>>>
and the following <<<test_start>>>. Assign to the preceding test where the name matches, else to the following test." does not solve the problem completely.My observation is:
1. Lines between <<<
test_end>>> and <<<test_start>>> belongs to the following test case and not to the preceding one.
2. Also, at times I have observed the test output is spread in such a way that few lines of the test output fall between <<<test_end>>> and <<<test_start>>> and rest of lines appear between the <<<test_start>>> and <<<test_output>>> of the corresponding testcase.Regards,
rohitOn Fri, May 22, 2009 at 12:22 PM, Subrata Modak <[email protected]> wrote:
On Thu, 2009-05-21 at 01:13 -0700, Marc Gauthier wrote:
> Hi, my first patch to this list. Actually not a patch,
> but the files themselves, to avoid line-wrapping issues
> and because the diff is twice the size of the new file.
>
> -MarcThanks Marc.
Rohit,
Can you test this and see if these solves the problem that you were
discussing for long ?Regards--
Subrata>
>
> -----------
> Detect test results more accurately when generating HTML
>
> Process test output lines that appear between <<<test_end>>>
> and the following <<<test_start>>>. Assign to the preceding
> test where the name matches, else to the following test.
>
> If a single test has multiple types of results (e.g. both
> FAIL and WARN), report only the most significant one, to
> avoid mis-computing the total number of PASS tests or
> total counts that don't add up to the number of tests.
>
> If a test's output has no explicit result (PASS, FAIL, etc),
> look at the exit value to determine whether it passed.
>
> Setting theSHOW_UNRESOLVEDenvironment variable to 1
> classifies as UNRESOLVED any test with no explicit result
> and a zero exit code.
>
> Setting theSUMMARY_OUTPUTenvironment variable to 1
> causes only one line of output per test to be shown, for a
> tighter page that allows quickly scanning the results.
>
> Show percentage of each result type in summary section.
>
> Simplify parsing a bit.
>
> Signed-off-by: Marc Gauthier <[email protected]>
>
>
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Okay, so I looked at it a bit...
Isn't the fundamental race condition because pan outputs <<<test_start>>> *after* doing the fork(), rather than before?
If some status info can't be output that early, maybe it just needs to be output after <<<execution_status>>> as part of write_test_end() ?
-Marc
P.S. I find it useful to run genhtml against older LTP releases (including those without genhtml), so might be useful to keep the out-of-order workarounds even if ordering is fixed in this release.
Quoted 35 lines · Subrata Modak
How much would you want to delay ? May be to some microsecs !! However delaying is not a good option, but, i am ready to consider. See, what is the reasanable time so that this problem vanishes.
Meanwhile, i have generated this small patch. It tries to flush all data
to be written to STDOUT before the Parent (PAN) tries to write his next tag. Moreover, i have included thefflush()to be executed inside the if()´s domain whenever the parent is writing from <<test_start>> till <<test_output>>. See, if this can help in solving the problem.Signed-off-by Subrata Modak <[email protected]>---
--- ltp-intermediate-20090521/pan/ltp-pan.c.orig
2009-05-26 16:30:39.000000000 +0530+++
ltp-intermediate-20090521/pan/ltp-pan.c2009-05-26
19:44:37.000000000 +0530pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-0@@ -1015,6 +1015,7 @@ static pid_t run_child(struct coll_entry errbuf[errlen] ='\0' ;/* fprintf(stderr, "%s", errbuf); */ waitpid (cpid, &status,0 ); +fflush (stdout);/* Flush any data before writing <<test_end>>*/
if (WIFSIGNALED(status)) { termid = WTERMSIG(status); termtype = "signaled";pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1@@ -1300,14 +1301,14 @@ static void copy_buffered_output(structstatic void write_test_start (struct tag_pgrp *running,const char *init_status) { -if (!strcmp (reporttype,"rts" )) +if (!strcmp (reporttype,"rts" )) { printf("%s\ntag=%s
Quoted 1 line
stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\niniti
ation_status=\"%s\"\n%s\n",
pan/ltp-pan.c static void copy_buffered_output(struct · line 1312
Quoted 10 lines
"<<<test_start>>>", running->cmd->name, running->mystime, running->cmd->cmdline, "", "exit", init_status, "<<<test_output>>>");pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1-fflush (stdout); + } }
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi Marc,
I think this a possible solution. I think the tag "initiation_status=" can be moved after <<<execution_status>>>. Moving this tag to write_test_end() and shifting write_test_start() before fork() might solve the problem. However, corresponding changes have to be done in genhtml.pl
Subrata: Just let me your view on this. I'll try and come up with a patch if the changes are acceptable.
Regards,
Rohit.
Quoted 46 lines · Marc Gauthier
Okay, so I looked at it a bit...
Isn't the fundamental race condition because pan outputs <<<
test_start>>> *after* doing thefork(), rather than before?If some status info can't be output that early, maybe it just needs to be output after <<<
execution_status>>> as part ofwrite_test_end()?-Marc
P.S. I find it useful to run genhtml against older LTP releases (including those without genhtml), so might be useful to keep the out-of-order workarounds even if ordering is fixed in this release.Quoted 29 lines · Subrata Modak
How much would you want to delay ? May be to some microsecs !! However delaying is not a good option, but, i am ready to consider. See, what is the reasanable time so that this problem vanishes.
Meanwhile, i have generated this small patch. It tries to flush all data
to be written to STDOUT before the Parent (PAN) tries to write his next tag. Moreover, i have included thefflush()to be executed inside the if()´s domain whenever the parent is writing from <<test_start>> till <<test_output>>. See, if this can help in solving the problem.Signed-off-by Subrata Modak <[email protected]>---
--- ltp-intermediate-20090521/pan/ltp-pan.c.orig
2009-05-26 16:30:39.000000000 +0530+++
ltp-intermediate-20090521/pan/ltp-pan.c2009-05-26 19:44:37.000000000 +0530pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-0@@ -1015,6 +1015,7 @@ static pid_t run_child(struct coll_entry errbuf[errlen] = '\0'; /* fprintf(stderr, "%s", errbuf); */ waitpid(cpid, &status, 0); + fflush(stdout); /* Flush any data beforewriting <<test_end>>*/
if (WIFSIGNALED(status)) {
termid = WTERMSIG(status);
termtype = "signaled";(quoted diff) +0
-0@@ -1300,14 +1301,14 @@ static void copy_buffered_output(struct
Quoted 19 lines
Quoted 7 lines
static void
write_test_start(struct tag_pgrp *running, const char *init_status)
{
- if (!strcmp(reporttype, "rts"))
+ if (!strcmp(reporttype, "rts")) { printf("%s\ntag=%s stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\ninitiation_status=\"%s\"\n%s\n",
Quoted 10 lines
"<<<test_start>>>",
running->cmd->name,running->mystime,running->cmd->cmdline, "",
"exit",init_status, "<<<test_output>>>");
-
fflush(stdout);
+ }
}
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<execution_status>>> (it only looks at tag names, not positions).
-Marc
Quoted 39 lines · rohit verma
Hi Marc,
I think this a possible solution. I think the tag "initiation_status=" can be moved after <<<
execution_status>>>. Moving this tag towrite_test_end()and shiftingwrite_test_start()beforefork()might solve the problem. However, corresponding changes have to be done in genhtml.plSubrata: Just let me your view on this. I'll try and come up with a patch if the changes are acceptable.
Regards,
Rohit.Quoted 21 lines · Marc Gauthier
Okay, so I looked at it a bit...
Isn't the fundamental race condition because pan outputs <<<
test_start>>> *after* doing thefork(), rather than before?If some status info can't be output that early, maybe it just needs to be output after <<<
execution_status>>> as part ofwrite_test_end()?-Marc
P.S. I find it useful to run genhtml against older LTP releases (including those without genhtml), so might be useful to keep the out-of-order workarounds even if ordering is fixed in this release.Quoted 4 lines · Subrata Modak
How much would you want to delay ? May be to some microsecs !! However delaying is not a good option, but, i am ready to consider. See, what is the reasanable time so that this problem vanishes.
Quoted 47 lines
Quoted 4 lines
Quoted 4 lines
Meanwhile, i have generated this small patch. It tries to flush all data
to be written to STDOUT before the Parent (PAN) tries to write his next tag. Moreover, i have included thefflush()to beexecuted inside
Quoted 1 line
Quoted 1 line
the if()´s domain whenever the parent is writing from
<<
test_start>>Quoted 39 lines
Quoted 26 lines
till <<
test_output>>. See, if this can help in solving the problem.Signed-off-by Subrata Modak <[email protected]>---
--- ltp-intermediate-20090521/pan/ltp-pan.c.orig
2009-05-26 16:30:39.000000000 +0530+++
ltp-intermediate-20090521/pan/ltp-pan.c2009-05-26
19:44:37.000000000 +0530pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-0@@ -1015,6 +1015,7 @@ static pid_t run_child(struct coll_entry errbuf[errlen] ='\0' ;/* fprintf(stderr, "%s", errbuf); */ waitpid (cpid, &status,0 ); +fflush (stdout);/* Flush any data before writing <<test_end>>*/
if (WIFSIGNALED(status)) { termid = WTERMSIG(status); termtype = "signaled";pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1@@ -1300,14 +1301,14 @@ static void copy_buffered_output(structstatic void write_test_start (struct tag_pgrp *running,const char *init_status) { -if (!strcmp (reporttype,"rts" )) +if (!strcmp (reporttype,"rts" )) { printf("%s\ntag=%sQuoted 1 line
stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\niniti
ation_status=\"%s\"\n%s\n",
Quoted 10 lines
"<<<test_start>>>", running->cmd->name, running->mystime, running->cmd->cmdline, "", "exit", init_status, "<<<test_output>>>");pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1-fflush (stdout); + } }
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).
Be careful, it looks for <<<execution_status>>> only in between <<test_start>> & <<test_output>>.
Regards--
Subrata
Quoted 91 lines
-Marc
Quoted 86 lines · rohit verma
Hi Marc,
I think this a possible solution. I think the tag "initiation_status=" can be moved after <<<
execution_status>>>. Moving this tag towrite_test_end()and shiftingwrite_test_start()beforefork()might solve the problem. However, corresponding changes have to be done in genhtml.plSubrata: Just let me your view on this. I'll try and come up with a patch if the changes are acceptable.
Regards,
Rohit.Quoted 9 lines · Marc Gauthier
Okay, so I looked at it a bit...
Isn't the fundamental race condition because pan outputs <<<
test_start>>> *after* doing thefork(), rather than before?If some status info can't be output that early, maybe it just needs to be output after <<<
execution_status>>> as part ofwrite_test_end()?Quoted 16 lines
-Marc
P.S. I find it useful to run genhtml against older LTP releases (including those without genhtml), so might be useful to keep the out-of-order workarounds even if ordering is fixed in this release.Quoted 8 lines · Subrata Modak
How much would you want to delay ? May be to some microsecs !! However delaying is not a good option, but, i am ready to consider. See, what is the reasanable time so that this problem vanishes.
Meanwhile, i have generated this small patch. It tries to flush all data
to be written to STDOUT before the Parent (PAN) tries to write his next tag. Moreover, i have included thefflush()to beexecuted inside
Quoted 1 line
Quoted 1 line
the if()´s domain whenever the parent is writing from
<<
test_start>>Quoted 39 lines
Quoted 26 lines
till <<
test_output>>. See, if this can help in solving the problem.Signed-off-by Subrata Modak <[email protected]>---
--- ltp-intermediate-20090521/pan/ltp-pan.c.orig
2009-05-26 16:30:39.000000000 +0530+++
ltp-intermediate-20090521/pan/ltp-pan.c2009-05-26
19:44:37.000000000 +0530pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-0@@ -1015,6 +1015,7 @@ static pid_t run_child(struct coll_entry errbuf[errlen] ='\0' ;/* fprintf(stderr, "%s", errbuf); */ waitpid (cpid, &status,0 ); +fflush (stdout);/* Flush any data before writing <<test_end>>*/
if (WIFSIGNALED(status)) { termid = WTERMSIG(status); termtype = "signaled";pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1@@ -1300,14 +1301,14 @@ static void copy_buffered_output(structstatic void write_test_start (struct tag_pgrp *running,const char *init_status) { -if (!strcmp (reporttype,"rts" )) +if (!strcmp (reporttype,"rts" )) { printf("%s\ntag=%sQuoted 1 line
stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\niniti
ation_status=\"%s\"\n%s\n",
Quoted 10 lines
"<<<test_start>>>", running->cmd->name, running->mystime, running->cmd->cmdline, "", "exit", init_status, "<<<test_output>>>");pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1-fflush (stdout); + } }
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 7 lines · Subrata Modak
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).Be careful, it looks for <<<
execution_status>>> only in between <<test_start>> & <<test_output>>.
You mean, between <<<test_start>>> and <<<test_end>>> ? (the script I submitted recently that is, was careful about this)
-Marc
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 11 lines · Marc Gauthier
Quoted 7 lines · Subrata Modak
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).Be careful, it looks for <<<
execution_status>>> only in between <<test_start>> & <<test_output>>.You mean, between <<<
test_start>>> and <<<test_end>>> ? (the script I submitted recently that is, was careful about this)
You made changes in genhtml.pl. I want the change(s) in ltp-pan.c.
Regards--
Subrata
Quoted 2 lines
-Marc
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi Subrata,
PFA the patch for the changes to pan driver for a possible fix to the report generation issue.
I have modified genhtml.pl script to reflect changes in pan driver.
Note: The 'Initiation-status' column is now present after Test-output column.
Please check the same and provide your feedback.
Regards,
Rohit.
Quoted 10 lines · Subrata Modak
Quoted 9 lines · Marc Gauthier
Quoted 7 lines · Subrata Modak
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).Be careful, it looks for <<<
execution_status>>> only in between <<test_start>> & <<test_output>>.
Quoted 12 lines
Quoted 2 lines
You mean, between <<<
test_start>>> and <<<test_end>>> ? (the script I submitted recently that is, was careful about this)You made changes in genhtml.pl. I want the change(s) in
ltp-pan.c.Regards--
SubrataQuoted 2 lines
-Marc
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Patch file attached.
Quoted 9 lines · rohit verma
Hi Subrata,
PFA the patch for the changes to pan driver for a possible fix to the report generation issue.
I have modified genhtml.pl script to reflect changes in pan driver.
Note: The 'Initiation-status' column is now present after Test-output column.
Quoted 30 lines
Please check the same and provide your feedback.
Regards,
Rohit.Quoted 22 lines · Subrata Modak
Quoted 11 lines · Marc Gauthier
Quoted 7 lines · Subrata Modak
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).Be careful, it looks for <<<
execution_status>>> only in between <<test_start>> & <<test_output>>.You mean, between <<<
test_start>>> and <<<test_end>>> ? (the script I submitted recently that is, was careful about this)You made changes in genhtml.pl. I want the change(s) in
ltp-pan.c.Regards--
SubrataQuoted 2 lines
-Marc
pan/pan.c +22 -20
@@ -115,8 +115,8 @@static void check_orphans (struct orphan_pgrp *orphans,int sig);static void copy_buffered_output (struct tag_pgrp *running); -static void write_test_start (struct tag_pgrp *running,const char *init_status); -static void write_test_end (struct tag_pgrp *running, +static void write_test_start (struct tag_pgrp *running); +static void write_test_end (struct tag_pgrp *running,const char *init_status,time_t exit_time,char *term_type,int stat_loc,int term_id,struct tms *tms1,struct tms *tms2);
@@ -755,12 +755,12 @@if (test_out_dir) {if (!quiet_mode) -write_test_start (running+i,"ok" ); +write_test_start (running+i);copy_buffered_output (running + i);unlink (running[i].output); }if (!quiet_mode) -write_test_end (running+i, t, status, +write_test_end (running+i,"ok" , t, status, stat_loc, w, &tms1, &tms2);/* If signaled and we weren't expecting
@@ -844,6 +844,13 @@return -1 ; } +time (&active->mystime); + active->cmd = colle; + +if (!test_out_dir) +if (!quiet_mode) +write_test_start (active); +if ((cpid =fork ()) <0 ) {fprintf (stderr,"pan(%s): fork failed (tag %s). errno:%d %s\n" , panname, colle->name, errno,strerror (errno));
@@ -926,8 +933,6 @@if (colle->pcnt_f)free (c_cmdline);close (errpipe[1 ]); -time (&active->mystime); - active->cmd = colle;/* if the child couldn't go through with the exec, * clean up the mess, note it, and move on
@@ -960,8 +965,8 @@time (&end_time);if (!quiet_mode) { -write_test_start (active, errbuf); -write_test_end (active, end_time, termtype, status, +//write_test_start(active, errbuf); +write_test_end (active, errbuf, end_time, termtype, status, termid, ¬ime, ¬ime); }if (capturing) {
@@ -973,10 +978,6 @@close (errpipe[0 ]);if (capturing)close (c_stdout); - -if (!test_out_dir) -if (!quiet_mode) -write_test_start (active,"ok" ); active->pgrp = cpid; active->stopping =0 ;
@@ -1212,14 +1213,14 @@static void -write_test_start (struct tag_pgrp *running,const char *init_status) +write_test_start (struct tag_pgrp *running) {if (!strcmp (reporttype,"rts" )) { -printf ("%s\ntag=%s stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\ninitiation_status=\"%s\"\n%s\n" , +printf ("%s\ntag=%s stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\n%s\n" ,"<<<test_start>>>" , running->cmd->name, running->mystime, running->cmd->cmdline,"" , -"exit" , init_status, +"exit" ,"<<<test_output>>>" ); }fflush (stdout);
@@ -1227,13 +1228,14 @@static void -write_test_end (struct tag_pgrp *running,time_t exit_time, -char *term_type,int stat_loc,int term_id, -struct tms *tms1,struct tms *tms2) +write_test_end (struct tag_pgrp *running,const char *init_status, +time_t exit_time,char *term_type,int stat_loc, +int term_id,struct tms *tms1,struct tms *tms2) {if (!strcmp (reporttype,"rts" )) { - printf("%s\nduration=%ld termination_type=%s termination_id=%d corefile=%s\ncutime=%d cstime=%d\n%s\n", - "<<<execution_status>>>", + printf("%s\ninitiation_status=\"%s\"\nduration=%ld termination_type=%s " + "termination_id=%d corefile=%s\ncutime=%d cstime=%d\n%s\n", + "<<<execution_status>>>", init_status, (long) (exit_time - running->mystime), term_type, term_id, (stat_loc & 0200) ? "yes" : "no", (int) (tms2->tms_cutime - tms1->tms_cutime),
tools/genhtml.pl +5 -5
@@ -144,12 +144,12 @@ @variable_value_pair = split(/=/, $line); $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n"; } - if ( $flag == 6) { #Assuming we will find "initiation_status" value here - @variable_value_pair = split(/=/, $line); - $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n"; - } if ( $flag3 == 1 ) { if ( $flag4 == 1 ) { + @variable_value_pair = split(/=/, $line); + $row_line = $row_line . "<td><p><strong>$variable_value_pair[1]</strong></p></td>\n"; + } + if ( $flag4 == 2 ) { @variable_value_pair = split(/\ /, $line); @duration_value = split(/=/, $variable_value_pair[0]); @termination_type_value = split(/=/, $variable_value_pair[1]);
@@ -162,7 +162,7 @@ "<td><p><strong>$corefile_value[1]</strong></p></td>\n"; $row_line =~ s/<tr>/<tr\ bgcolor=$background_colour>/; } - if ( $flag4 == 2 ) { + if ( $flag4 == 3 ) { @variable_value_pair = split(/\ /, $line); @cutime_value = split(/=/, $variable_value_pair[0]); @cstime_value = split(/=/, $variable_value_pair[1]);
tools/html_report_header.txt +1 -1
@@ -46,8 +46,8 @@ <td bgcolor="Silver"><strong>Command-Line</strong></td> <td bgcolor="Silver"><strong>Contacts</strong></td> <td bgcolor="Silver"><strong>Analysis</strong></td> - <td bgcolor="Silver"><strong>Initiation-Status</strong></td> <td bgcolor="Silver"><strong>Test-Output</strong></td> + <td bgcolor="Silver"><strong>Initiation-Status</strong></td> <td bgcolor="Silver"><strong>Duration</strong></td> <td bgcolor="Silver"><strong>Termination-type</strong></td> <td bgcolor="Silver"><strong>Termination-id</strong></td>
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 1 line · rohit verma
Patch file attached.
I will look into this.
Regards--
Subrata
Quoted 33 lines · rohit verma
Quoted 31 lines
Hi Subrata,
PFA the patch for the changes to pan driver for a possible fix to the report generation issue.
I have modified genhtml.pl script to reflect changes in pan driver.
Note: The 'Initiation-status' column is now present after Test-output column.
Please check the same and provide your feedback.
Regards,
Rohit.Quoted 15 lines · Subrata Modak
Quoted 11 lines · Marc Gauthier
Quoted 7 lines · Subrata Modak
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).Be careful, it looks for <<<
execution_status>>> only in between <<test_start>> & <<test_output>>.You mean, between <<<
test_start>>> and <<<test_end>>> ? (the script I submitted recently that is, was careful about this)You made changes in genhtml.pl. I want the change(s) in
ltp-pan.c.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Regards--
SubrataQuoted 2 lines
-Marc
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 1 line · rohit verma
Patch file attached.
Thanks.
Regards--
Subrata
Quoted 33 lines · rohit verma
Quoted 31 lines
Hi Subrata,
PFA the patch for the changes to pan driver for a possible fix to the report generation issue.
I have modified genhtml.pl script to reflect changes in pan driver.
Note: The 'Initiation-status' column is now present after Test-output column.
Please check the same and provide your feedback.
Regards,
Rohit.Quoted 15 lines · Subrata Modak
Quoted 11 lines · Marc Gauthier
Quoted 7 lines · Subrata Modak
Quoted 3 lines · Marc Gauthier
Just so you know, the updated genhtml.pl script recently submitted should work just fine without changes, when moving status after <<<
execution_status>>> (it only looks at tag names, not positions).Be careful, it looks for <<<
execution_status>>> only in between <<test_start>> & <<test_output>>.You mean, between <<<
test_start>>> and <<<test_end>>> ? (the script I submitted recently that is, was careful about this)You made changes in genhtml.pl. I want the change(s) in
ltp-pan.c.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Regards--
SubrataQuoted 2 lines
-Marc
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 7 lines · rohit verma
Hi Marc,
I think this a possible solution. I think the tag "initiation_status=" can be moved after <<<
execution_status>>>. Moving this tag towrite_test_end()and shiftingwrite_test_start()beforefork()might solve the problem. However, corresponding changes have to be done in genhtml.pl
Yes, changes are required then in genhtml.pl also. So, go ahead and test your solution.
Regards--
Subrata
Quoted 4 lines
Subrata: Just let me your view on this. I'll try and come up with a patch if the changes are acceptable.
Quoted 71 lines
Regards,
Rohit.Quoted 65 lines · Marc Gauthier
Okay, so I looked at it a bit...
Isn't the fundamental race condition because pan outputs <<<
test_start>>> *after* doing thefork(), rather than before?If some status info can't be output that early, maybe it just needs to be output after <<<
execution_status>>> as part ofwrite_test_end()?-Marc
P.S. I find it useful to run genhtml against older LTP releases (including those without genhtml), so might be useful to keep the out-of-order workarounds even if ordering is fixed in this release.Quoted 35 lines · Subrata Modak
How much would you want to delay ? May be to some microsecs !! However delaying is not a good option, but, i am ready to consider. See, what is the reasanable time so that this problem vanishes.
Meanwhile, i have generated this small patch. It tries to flush all data
to be written to STDOUT before the Parent (PAN) tries to write his next tag. Moreover, i have included thefflush()to be executed inside the if()´s domain whenever the parent is writing from <<test_start>> till <<test_output>>. See, if this can help in solving the problem.Signed-off-by Subrata Modak <[email protected]>---
--- ltp-intermediate-20090521/pan/ltp-pan.c.orig
2009-05-26 16:30:39.000000000 +0530+++
ltp-intermediate-20090521/pan/ltp-pan.c2009-05-26
19:44:37.000000000 +0530pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-0@@ -1015,6 +1015,7 @@ static pid_t run_child(struct coll_entry errbuf[errlen] ='\0' ;/* fprintf(stderr, "%s", errbuf); */ waitpid (cpid, &status,0 ); +fflush (stdout);/* Flush any data before writing <<test_end>>*/
if (WIFSIGNALED(status)) { termid = WTERMSIG(status); termtype = "signaled";pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1@@ -1300,14 +1301,14 @@ static void copy_buffered_output(structstatic void write_test_start (struct tag_pgrp *running,const char *init_status) { -if (!strcmp (reporttype,"rts" )) +if (!strcmp (reporttype,"rts" )) { printf("%s\ntag=%sQuoted 1 line
stime=%ld\ncmdline=\"%s\"\ncontacts=\"%s\"\nanalysis=%s\niniti
ation_status=\"%s\"\n%s\n",
Quoted 10 lines
"<<<test_start>>>", running->cmd->name, running->mystime, running->cmd->cmdline, "", "exit", init_status, "<<<test_output>>>");pan/ltp-pan.c renamed from pan/ltp-pan.c.orig +1
-1-fflush (stdout); + } }
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list