comparison mercurial/configitems.py @ 50215:ae61851e6fe2 stable

dirstate: add a way to test races happening during status We add the `devel.sync.status.pre-dirstate-write-file` config option to easily test what happens when other operations happen during the window where `hg status` is done working but has not updated the cache on disk yet. We introduce the framework for testing such races too, actual tests will be added in the next changesets. For now the test is only checking dirstate-v1. We will extend the test coverage later too. Check test documentation for details. Code change from Rapha?l Gom?s <rgomes@octobus.net> Test change from Pierre-Yves David <pierre-yves.david@octobus.net>
author Rapha?l Gom?s <rgomes@octobus.net>, Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 28 Feb 2023 15:25:47 +0100
parents a3356ab610fc
children ecd28d89c29e
comparison
equal deleted inserted replaced
50214:8e0d823ef182 50215:ae61851e6fe2
675 coreconfigitem( 675 coreconfigitem(
676 b'devel', 676 b'devel',
677 b'serverrequirecert', 677 b'serverrequirecert',
678 default=False, 678 default=False,
679 ) 679 )
680 # Makes the status algorithm wait for the existence of this file
681 # (or until a timeout of `devel.sync.status.pre-dirstate-write-file-timeout`
682 # seconds) before taking the lock and writing the dirstate.
683 # Status signals that it's ready to wait by creating a file
684 # with the same name + `.waiting`.
685 # Useful when testing race conditions.
686 coreconfigitem(
687 b'devel',
688 b'sync.status.pre-dirstate-write-file',
689 default=None,
690 )
691 coreconfigitem(
692 b'devel',
693 b'sync.status.pre-dirstate-write-file-timeout',
694 default=2,
695 )
680 coreconfigitem( 696 coreconfigitem(
681 b'devel', 697 b'devel',
682 b'strip-obsmarkers', 698 b'strip-obsmarkers',
683 default=True, 699 default=True,
684 ) 700 )