Improve tests to work better on jenkins

Change-Id: Ie7fb027db3b744ed020bfa821b1ee3860d700269