You've already forked pgbackrest
							
							
				mirror of
				https://github.com/pgbackrest/pgbackrest.git
				synced 2025-10-30 23:37:45 +02:00 
			
		
		
		
	Looks like all unit tests pass - now for a long test run to see if that is really true. And to see if the old lockup is gone.
This commit is contained in:
		| @@ -814,7 +814,8 @@ sub hash | ||||
|             do | ||||
|             { | ||||
|                 # Read a block from the file | ||||
|                 $iBlockSize = sysread($hFile, $tCompressedBuffer, 1000000); | ||||
|                 $iBlockSize = sysread($hFile, $tCompressedBuffer, 1000000, | ||||
|                                       defined($tCompressedBuffer) ? length($tCompressedBuffer) : 0); | ||||
|  | ||||
|                 if (!defined($iBlockSize)) | ||||
|                 { | ||||
|   | ||||
| @@ -35,10 +35,10 @@ use constant | ||||
|  | ||||
| #################################################################################################################################### | ||||
| # Remote xfer default block size constant | ||||
| ##################################################################################################################################### | ||||
| #################################################################################################################################### | ||||
| use constant | ||||
| { | ||||
|     DEFAULT_BLOCK_SIZE  => 8388608 | ||||
|     DEFAULT_BLOCK_SIZE  => 99999 | ||||
| }; | ||||
|  | ||||
| #################################################################################################################################### | ||||
| @@ -444,9 +444,10 @@ sub stream_read | ||||
|     my $hIn = shift; | ||||
|     my $tBlockRef = shift; | ||||
|     my $iBlockSize = shift; | ||||
|     my $bOffset = shift; | ||||
|  | ||||
|     # Read a block from the stream | ||||
|     my $iBlockIn = sysread($hIn, $$tBlockRef, $iBlockSize); | ||||
|     my $iBlockIn = sysread($hIn, $$tBlockRef, $iBlockSize, $bOffset ? length($$tBlockRef) : false); | ||||
|  | ||||
|     if (!defined($iBlockIn)) | ||||
|     { | ||||
| @@ -636,6 +637,7 @@ sub binary_xfer | ||||
|                     $oGzip = new IO::Compress::Gzip(\$strBlock, Append => 1) | ||||
|                         or confess "IO::Compress::Gzip failed: $GzipError"; | ||||
|  | ||||
|                     # Clear first block flag | ||||
|                     $bFirst = false; | ||||
|                 } | ||||
|  | ||||
| @@ -650,11 +652,14 @@ sub binary_xfer | ||||
|                     if (!defined($iBlockIn) || $iBlockIn != $iBlockBufferIn) | ||||
|                     { | ||||
|                         $self->wait_pid(); | ||||
|                         confess &log(ERROR, 'unable to read'); | ||||
|                         confess &log(ERROR, "IO::Compress::Gzip failed: $GzipError"); | ||||
|                     } | ||||
|  | ||||
|                     $self->block_write($hOut, \$strBlock); | ||||
|                     undef($strBlock); | ||||
|                     if (defined($strBlock) && length($strBlock) > $self->{iBlockSize}) | ||||
|                     { | ||||
|                         $self->block_write($hOut, \$strBlock); | ||||
|                         undef($strBlock); | ||||
|                     } | ||||
|                 } | ||||
|                 # If there was nothing new to compress then close | ||||
|                 else | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								test/data/test.archive-complex.bin
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								test/data/test.archive-complex.bin
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										37
									
								
								test/test.pl
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								test/test.pl
									
									
									
									
									
								
							| @@ -42,6 +42,7 @@ test.pl [options] | ||||
|    --module-test-run    execute only the specified test run | ||||
|    --dry-run            show only the tests that would be executed but don't execute them | ||||
|    --no-cleanup         don't cleaup after the last test is complete - useful for debugging | ||||
|    --infinite           repeat selected tests forever | ||||
|  | ||||
|  Configuration Options: | ||||
|    --psql-bin           path to the psql executables (e.g. /usr/lib/postgresql/9.3/bin/) | ||||
| @@ -68,6 +69,7 @@ my $strTestPath; | ||||
| my $bVersion = false; | ||||
| my $bHelp = false; | ||||
| my $bQuiet = false; | ||||
| my $bInfinite = false; | ||||
|  | ||||
| GetOptions ('q|quiet' => \$bQuiet, | ||||
|             'version' => \$bVersion, | ||||
| @@ -79,7 +81,8 @@ GetOptions ('q|quiet' => \$bQuiet, | ||||
|             'module-test=s' => \$strModuleTest, | ||||
|             'module-test-run=s' => \$iModuleTestRun, | ||||
|             'dry-run' => \$bDryRun, | ||||
|             'no-cleanup' => \$bNoCleanup) | ||||
|             'no-cleanup' => \$bNoCleanup, | ||||
|             'infinite' => \$bInfinite) | ||||
|     or pod2usage(2); | ||||
|  | ||||
| # Display version and exit if requested | ||||
| @@ -202,20 +205,32 @@ BackRestTestCommon_Setup($strTestPath, $strPgSqlBin, $iModuleTestRun, $bDryRun, | ||||
| # &log(INFO, "Testing with test_path = " . BackRestTestCommon_TestPathGet() . ", host = {strHost}, user = {strUser}, " . | ||||
| #            "group = {strGroup}"); | ||||
|  | ||||
| if ($strModule eq 'all' || $strModule eq 'utility') | ||||
| { | ||||
|     BackRestTestUtility_Test($strModuleTest); | ||||
| } | ||||
| my $iRun = 0; | ||||
|  | ||||
| if ($strModule eq 'all' || $strModule eq 'file') | ||||
| do | ||||
| { | ||||
|     BackRestTestFile_Test($strModuleTest); | ||||
| } | ||||
|     if ($bInfinite) | ||||
|     { | ||||
|         $iRun++; | ||||
|         &log(INFO, "INFINITE - RUN ${iRun}\n"); | ||||
|     } | ||||
|  | ||||
| if ($strModule eq 'all' || $strModule eq 'backup') | ||||
| { | ||||
|     BackRestTestBackup_Test($strModuleTest); | ||||
|     if ($strModule eq 'all' || $strModule eq 'utility') | ||||
|     { | ||||
|         BackRestTestUtility_Test($strModuleTest); | ||||
|     } | ||||
|  | ||||
|     if ($strModule eq 'all' || $strModule eq 'file') | ||||
|     { | ||||
|         BackRestTestFile_Test($strModuleTest); | ||||
|     } | ||||
|  | ||||
|     if ($strModule eq 'all' || $strModule eq 'backup') | ||||
|     { | ||||
|         BackRestTestBackup_Test($strModuleTest); | ||||
|     } | ||||
| } | ||||
| while ($bInfinite); | ||||
|  | ||||
| if (!$bDryRun) | ||||
| { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user