[tor-bugs] #17033 [metrics-lib]: failing tests due to system locale

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Sep 12 11:15:25 UTC 2015


#17033: failing tests due to system locale
-----------------------------+---------------------
     Reporter:  iwakeh       |      Owner:  karsten
         Type:  defect       |     Status:  new
     Priority:  minor        |  Milestone:
    Component:  metrics-lib  |    Version:
   Resolution:               |   Keywords:
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+---------------------

Comment (by iwakeh):

 Thanks for trying this out!

 The issue is more subtle:

 No matter what locale is set in the environment
 setting another locale for the unit tests makes the tests pass.
 For example, I set the environment to fr_FR.UTF-8 and used
 {{{ <jvmarg value="-Duser.language=cn -Duser.region=CN"/> }}}
 in the build script and the tests passed.

 Without the jvmargs and an environment like fi, fr, or de
 the tests will fail.
 (btw switching locales in the terminal didn't require any restarts.)

 I noticed that the locale has to be installed in order to become
 effective, i.e. I can set everything to fi_FI
 {{{
 LC_CTYPE="fi_FI.UTF-8"
 LC_NUMERIC="fi_FI.UTF-8"
 LC_TIME="fi_FI.UTF-8"
 LC_COLLATE="fi_FI.UTF-8"
 LC_MONETARY="fi_FI.UTF-8"
 LC_MESSAGES="fi_FI.UTF-8"
 LC_PAPER="fi_FI.UTF-8"
 LC_NAME="fi_FI.UTF-8"
 LC_ADDRESS="fi_FI.UTF-8"
 LC_TELEPHONE="fi_FI.UTF-8"
 LC_MEASUREMENT="fi_FI.UTF-8"
 LC_IDENTIFICATION="fi_FI.UTF-8"
 LC_ALL=fi_FI.UTF-8
 }}}

 and tests will pass without the above jvmargs.
 But, after installing/defining the fi_FI locale using {{{localdef}}}
 they fail without the jvmargs.

 So using any setting of
 user.language and user.region in the junit task makes the
 tests independent of system settings.

 Hope this is sufficient information for reproducing the test failures.

 PS:
 failed tests were:
 testOneFile and testSameFileTwoTimestampsLastWins

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17033#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list