diff options
Diffstat (limited to 'SBO-Lib/lib')
| -rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 8873bb5..490b278 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -115,6 +115,10 @@ our $tempdir = tempdir(CLEANUP => 1, DIR => $tmpd);  # t/01-test.t  our $pkg_db = '/var/log/packages'; +# _race::cond will allow both documenting and testing race conditions +# by overriding its implementation for tests +sub _race::cond { return } +  # subroutine for throwing internal script errors  sub script_error {  	if (@_) { @@ -139,6 +143,7 @@ sub open_fh {  	}  	my ($file, $op) = @_;  	my $fh; +	_race::cond 'possibly $file has been deleted between -f test and now';  	unless (open $fh, $op, $file) {  		my $warn = "Unable to open $file.\n";  		my $exit = _ERR_OPENFH;  | 
