+
+ @Test
+ @Ignore // This test is flaky on build server VMs (although fine locally)
+ public void slowYangLoadingShouldOnlyHappenOnceAndNotDelayEachDataBroker() {
+ // TODO Write a lil' Timer utility class to make this kind of timing test code more readable
+ long startAtMs = System.currentTimeMillis();
+ DataBrokerTestModule.dataBroker();
+ long firstDataBrokerAtMs = System.currentTimeMillis();
+ long firstDataBrokerDurationMs = firstDataBrokerAtMs - startAtMs;
+ DataBrokerTestModule.dataBroker();
+ long secondDataBrokerDurationMs = System.currentTimeMillis() - firstDataBrokerAtMs;
+ assertThat(Math.abs(secondDataBrokerDurationMs - firstDataBrokerDurationMs))
+ .isLessThan(firstDataBrokerDurationMs / 4);
+ }