[tor-bugs] #19720 [Metrics/CollecTor]: CollecTor should be re-configurable without restart

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Aug 10 10:46:04 UTC 2016


#19720: CollecTor should be re-configurable without restart
-------------------------------+---------------------------------
 Reporter:  iwakeh             |          Owner:  iwakeh
     Type:  enhancement        |         Status:  needs_review
 Priority:  High               |      Milestone:  CollecTor 1.0.0
Component:  Metrics/CollecTor  |        Version:
 Severity:  Normal             |     Resolution:
 Keywords:  ctip               |  Actual Points:
Parent ID:                     |         Points:
 Reviewer:                     |        Sponsor:
-------------------------------+---------------------------------

Comment (by iwakeh):

 A change for testConfigChange; now really writing to the file.

 {{{
 @@ -19,6 +19,7 @@ import org.junit.rules.TemporaryFolder;
  import java.io.ByteArrayInputStream;
  import java.io.File;
  import java.lang.reflect.Field;
 +import java.nio.file.Files;
  import java.nio.file.Paths;
  import java.util.Arrays;
  import java.util.Observable;
 @@ -173,7 +174,6 @@ public class ConfigurationTest {
      conf.setWatchableSourceAndLoad(Paths.get("/tmp/phantom.path"));
    }

 -  @Ignore("Test fails: Update was not called.")
    @Test()
    public void testConfigChange() throws Exception {
      Configuration conf = new Configuration();
 @@ -183,17 +183,17 @@ public class ConfigurationTest {
            called.set(true);
          }
        });
 -    File confFile = tmpf.newFile("empty");
 +    File confFile = tmpf.newFile("emptyConf");
      conf.setWatchableSourceAndLoad(confFile.toPath());
      confFile.setLastModified(System.currentTimeMillis());
 -    MainTest.waitSec(6);
 +    Files.write(confFile.toPath(), "##".getBytes());
 +    MainTest.waitSec(10);
      assertTrue("Update was not called.", called.get());
      called.set(false);
 -    MainTest.waitSec(6);
 +    MainTest.waitSec(10);
      assertFalse("Update was called.", called.get());
    }
 }}}

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


More information about the tor-bugs mailing list