Corey,
Have you tried using the integration testing framework that comes with
storm?
Testing.withSimulatedTimeLocalCluster(mkClusterParam,
new TestJob() {
@Override
public void run(ILocalCluster cluster) throws Exception {
CompleteTopologyParam completeTopologyParam = new CompleteTopologyParam();
completeTopologyParam
.setMockedSources(mockedSources);
completeTopologyParam.setStormConf(daemonConf);
completeTopologyParam.setTopologyName(getTopologyName());
Map result = Testing.completeTopology(cluster,
topology, completeTopologyParam);
});
-Vincent
On Mon, Aug 4, 2014 at 8:49 PM, Corey Nolet <[email protected]> wrote:
> I'm testing some sliding window algorithms with tuples emitted from a mock
> spout based on a timer but the amount of time it takes the topology to
> fully start up and activate seems to vary from computer to computer.
> Specifically, I just updated from 0.8.2 to 0.9.2-incubating and all of my
> tests are breaking because the time to activate the topology is taking
> longer (because of Netty possibly?). I'd like to make my tests more
> resilient to things like this.
>
> Is there something I can look at in LocalCluster where I could do
> "while(!notActive) { Thread.sleep(50) }" ?
>
> This is what my test looks like currently:
>
> StormTopology topology = buildTopology(...);
> Config conf = new Config();
> conf.setNumWorkers(1);
>
> LocalCluster cluster = new LocalCluster();
> cluster.submitTopology(getTopologyName(), conf, topology);
>
> try {
> Thread.sleep(4000);
> } catch (InterruptedException e) {
> e.printStackTrace();
> }
>
> cluster.shutdown();
>
> assertEquals(4, MockSinkBolt.getEvents().size());
>
>
>
> Thanks!
>
>
>