It looks like you are running into an issue with the synchronization not completing before the test is finished. You can try using the refresh() method on the $etudeCreated object before running the assertion. This will force the object to reload from the database and should ensure that the synchronization has completed.
$etudeCreated->refresh();
expect($etudeCreated->allRoles->count())->toBe(1);