[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #19720 [Metrics/CollecTor]: CollecTor should be re-configurable without restart
#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):
What file system are you testing on?
Does the following make the second test work?
{{{
diff --git
a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
index 6013d09..24ab17d 100644
--- a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
+++ b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
@@ -173,7 +173,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();
@@ -193,7 +192,6 @@ public class ConfigurationTest {
assertFalse("Update was called.", called.get());
}
- @Ignore("Test fails: expected:<0> but was:<2>")
@Test()
public void testConfigUnreadable() throws Exception {
Configuration conf = new Configuration();
@@ -206,17 +204,19 @@ public class ConfigurationTest {
File confFile = tmpf.newFile("empty");
conf.setWatchableSourceAndLoad(confFile.toPath());
confFile.delete();
- conf.setProperty(Key.CompressRelayDescriptorDownloads.name(),
"false");
- conf.setProperty(Key.ImportDirectoryArchives.name(), "false");
Dummy dummy = new Dummy(conf);
+ Field confField = CollecTorMain.class.getDeclaredField("config");
+ confField.setAccessible(true);
+ Configuration dummiesConf = (Configuration)(confField.get(dummy));
+ dummiesConf.setProperty(Key.CompressRelayDescriptorDownloads.name(),
+ "false");
+ dummiesConf.setProperty(Key.ImportDirectoryArchives.name(), "false");
+ assertEquals(2, dummiesConf.size());
tmpf.newFolder("empty");
MainTest.waitSec(6);
assertFalse("Update was called.", called.get());
assertEquals(0, conf.size());
- Field confField = CollecTorMain.class.getDeclaredField("config");
- confField.setAccessible(true);
- int size = ((Configuration)(confField.get(dummy))).size();
- assertEquals(2, size);
+ assertEquals(2, dummiesConf.size());
}
}
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/19720#comment:22>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs