Skip to content

Commit

Permalink
Stabilize timing in test to prevent race condition.
Browse files Browse the repository at this point in the history
The load/save test could sometimes fail because of a second crossing
during the test. By sleeping for a second before the time-sensitive
tests, we should avoid this condition. (More of a hueristic mod than an
actual fix.)
  • Loading branch information
cpanelWade committed Jul 11, 2011
1 parent 0ca29a0 commit 4023c9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions t/statefile_load_save.t
Expand Up @@ -26,6 +26,7 @@ File::Path::mkpath( $tmpdir ) or die "Unable to create tmpdir: $!";
# test valid creation
my $mock_obj = MockCacheable->new;

sleep 1; # match times for testing.
my $state = cPanel::StateFile->new( { state_file => $file, data_obj => $mock_obj } );
isa_ok( $state, 'cPanel::StateFile' );

Expand Down

0 comments on commit 4023c9c

Please sign in to comment.