You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Qiang Tian <ti...@gmail.com> on 2014/11/24 10:48:47 UTC
how to redirect hbase testcase log to stdin or other file?
Hi Guys,
I want to check *-output.txt file, but it is deleted if testcase run good.
currently I have to intentionally make it run fail so I can get the file.
thanks.
Re: how to redirect hbase testcase log to stdin or other file?
Posted by Sean Busbey <bu...@cloudera.com>.
If what you want from the output is something written by a logger, you can
make all tests log to a file by passing in -Dhbase.root.logger=LEVEL,DFRA
(where LEVEL is a log4j level i.e. DEBUG).
Here's a conversation that goes into more detail:
*http://s.apache.org/axq <http://s.apache.org/axq>*
If you want the output from a particular test, the -output.txt file will
remain if you use -Dtest to limit what runs.
ex:
busbey$ mvn -Dtest=TestAcidGuarantees#testGetAtomicity clean package
[INFO] Scanning for projects...
... SNIP ...
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.hadoop.hbase.TestAcidGuarantees
2014-11-24 09:47:17.485 java[50315:1903] Unable to load realm info from
SCDynamicStore
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 43.84 sec -
in org.apache.hadoop.hbase.TestAcidGuarantees
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
... SNIP ...
[INFO] Reactor Summary:
[INFO]
[INFO] HBase ............................................. SUCCESS [6.949s]
[INFO] HBase - Checkstyle ................................ SUCCESS [1.391s]
[INFO] HBase - Annotations ............................... SUCCESS [1.503s]
[INFO] HBase - Common .................................... SUCCESS [17.925s]
[INFO] HBase - Protocol .................................. SUCCESS [21.532s]
[INFO] HBase - Client .................................... SUCCESS [10.350s]
[INFO] HBase - Hadoop Compatibility ...................... SUCCESS [0.445s]
[INFO] HBase - Hadoop Two Compatibility .................. SUCCESS [1.827s]
[INFO] HBase - Prefix Tree ............................... SUCCESS [1.526s]
[INFO] HBase - Server .................................... SUCCESS
[1:25.396s]
[INFO] HBase - Testing Util .............................. SUCCESS [3.172s]
[INFO] HBase - Thrift .................................... SUCCESS [9.214s]
[INFO] HBase - Shell ..................................... SUCCESS [2.217s]
[INFO] HBase - Integration Tests ......................... SUCCESS [1.814s]
[INFO] HBase - Examples .................................. SUCCESS [1.636s]
[INFO] HBase - Rest ...................................... SUCCESS [3.662s]
[INFO] HBase - Assembly .................................. SUCCESS [1.808s]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2:53.440s
[INFO] Finished at: Mon Nov 24 09:48:28 CST 2014
[INFO] Final Memory: 125M/1114M
[INFO]
------------------------------------------------------------------------
busbey$ ls -lah hbase-server/target/surefire-reports/
total 3504
drwxr-xr-x 5 busbey staff 170B Nov 24 09:49 .
drwxr-xr-x 17 busbey staff 578B Nov 24 09:48 ..
-rw-r--r-- 1 busbey staff 5.4K Nov 24 09:47
TEST-org.apache.hadoop.hbase.TestAcidGuarantees.xml
-rw-r--r-- 1 busbey staff 1.7M Nov 24 09:47
org.apache.hadoop.hbase.TestAcidGuarantees-output.txt
-rw-r--r-- 1 busbey staff 335B Nov 24 09:47
org.apache.hadoop.hbase.TestAcidGuarantees.txt
HTH.
On Mon, Nov 24, 2014 at 3:48 AM, Qiang Tian <ti...@gmail.com> wrote:
> Hi Guys,
> I want to check *-output.txt file, but it is deleted if testcase run good.
> currently I have to intentionally make it run fail so I can get the file.
>
> thanks.
>
--
Sean
Re: how to redirect hbase testcase log to stdin or other file?
Posted by Ted Yu <yu...@gmail.com>.
One option is to set the output buffer of your IDE large enough so that
test output is retained.
Another option, though tedious, is to issue 'tail -f ' command and redirect
its output to a file when the test is running.
Cheers
On Mon, Nov 24, 2014 at 1:48 AM, Qiang Tian <ti...@gmail.com> wrote:
> Hi Guys,
> I want to check *-output.txt file, but it is deleted if testcase run good.
> currently I have to intentionally make it run fail so I can get the file.
>
> thanks.
>