diff --git a/tests/+nansen/+fixture/ProjectFixture.m b/tests/+nansen/+fixture/ProjectFixture.m index 4934f007..250aaee3 100644 --- a/tests/+nansen/+fixture/ProjectFixture.m +++ b/tests/+nansen/+fixture/ProjectFixture.m @@ -21,7 +21,13 @@ function setup(fixture) F = fixture.applyFixture( TemporaryFolderFixture ); % Create a user profile for testing. Todo: make fixture - userProfileName = sprintf('test%d', randi(999)); + % The profile folder lives in prefdir, which all MATLAB processes + % on a machine share, and every fresh MATLAB process starts from + % the same default RNG seed, so a name drawn with randi can repeat + % across test processes that start together. A uuid is unique per + % process and per fixture instance. The "test" prefix keeps leftover + % profiles recognisable. + userProfileName = sprintf('test_%s', nansen.util.getuuid()); fixture.addTeardown( ... @() fixture.deleteUserProfile(userProfileName) )