By default drone uses a session file. It is by default created in $HOME and it is not always useful. You can override it by a system property but if you don’t want such a file and can’t wait for the fix (should be in Drone 2) then you can write a small Arquillian extension to skip it:
import org.jboss.arquillian.core.spi.LoadableExtension; import org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ReusedSessionPermanentFileStorage; import org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ReusedSessionPermanentStorage; import org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ReusedSessionStore; // no storage so don't share sessions accross tests public class DroneNoSessionStorageExtension implements LoadableExtension { @Override public void register(final ExtensionBuilder builder) { builder.override(ReusedSessionPermanentStorage.class, ReusedSessionPermanentFileStorage.class, DroneNoSessionStorage.class); } public static class DroneNoSessionStorage implements ReusedSessionPermanentStorage { @Override public ReusedSessionStore loadStore() { return null; } @Override public void writeStore(final ReusedSessionStore store) { // no-op } } }
Just add a META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension with the qualified name of this extension and that’s it :). No more session file will be created.
Tracking as https://issues.jboss.org/browse/ARQ-1874
This file should indeed be created and used only if remoteReusable flag is set.
Hi, could you provide a reproducer, please? I was trying to reproduce the issue, but without any success. Please see my comment https://issues.jboss.org/browse/ARQ-1874 If you don’t agree, fell free to reopen the issue and attach the reproducer.
Code seems to have changed so this hack is not more needed yes, thanks Karel to let us know!