Buggy code:
public class TestTwoSitePlans extends TestCase { static final String JAR = "distplanningregression.jar" ; ExecutionSite site1 ; ExecutionSite site2 ; ExecutionEngine ee1 ; ExecutionEngine ee2 ; Catalog catalog = null ; Cluster cluster = null ; Procedure selectProc = null ; Statement selectStmt = null ; PlanFragment selectTopFrag = null ; PlanFragment selectBottomFrag = null ; @ Override public void setUp ( ) throws IOException { VoltDB . instance ( ) . readBuildInfo ( "Test" ) ; String testDir = BuildDirectoryUtils . getBuildDirectoryPath ( ) ; String catalogJar = ( testDir + ( File . separator ) ) + ( TestTwoSitePlans . JAR ) ; TPCCProjectBuilder pb = new TPCCProjectBuilder ( ) ; pb . addDefaultSchema ( ) ; pb . addDefaultPartitioning ( ) ; pb . addProcedures ( MultiSiteSelect . class , InsertNewOrder . class ) ; pb . compile ( catalogJar , 2 , 0 ) ; byte [ ] bytes = CatalogUtil . toBytes ( new File ( catalogJar ) ) ; String serializedCatalog = CatalogUtil . loadCatalogFromJar ( bytes , null ) ; catalog = new Catalog ( ) ; catalog . execute ( serializedCatalog ) ; String pathToDeployment = pb . getPathToDeployment ( ) ; assertTrue ( ( ( CatalogUtil . compileDeploymentAndGetCRC ( catalog , pathToDeployment , true ) ) >= 0 ) ) ; cluster = catalog . getClusters ( ) . get ( "cluster" ) ; CatalogMap < Procedure > procedures = cluster . getDatabases ( ) . get ( "database" ) . getProcedures ( ) ; Procedure insertProc = procedures . get ( "InsertNewOrder" ) ; assert insertProc != null ; selectProc = procedures . get ( "MultiSiteSelect" ) ; assert ( selectProc ) != null ; site1 = new ExecutionSite ( 0 ) ; ee1 = new org . voltdb . jni . ExecutionEngineJNI ( site1 , cluster . getRelativeIndex ( ) , 1 , 0 , 0 , "" , 100 ) ; ee1 . loadCatalog ( 0 , catalog . serialize ( ) ) ; site2 = new ExecutionSite ( 1 ) ; <START_BUG> ee2 = new org . voltdb . jni . ExecutionEngineJNI ( site2 , cluster . getRelativeIndex ( ) , 2 , 0 , 0 , "" , 100 ) ; <END_BUG> ee2 . loadCatalog ( 0 , catalog . serialize ( ) ) ; selectStmt = selectProc . getStatements ( ) . get ( "selectAll" ) ; assert ( selectStmt ) != null ; int i = 0 ; for ( PlanFragment f : selectStmt . getFragments ( ) ) { if ( i == 0 ) selectTopFrag = f ; else selectBottomFrag = f ; i ++ ; } assert ( selectTopFrag ) != null ; assert ( selectBottomFrag ) != null ; if ( ( selectTopFrag . getHasdependencies ( ) ) == false ) { PlanFragment temp = selectTopFrag ; selectTopFrag = selectBottomFrag ; selectBottomFrag = temp ; } Statement insertStmt = insertProc . getStatements ( ) . get ( "insert" ) ; assert insertStmt != null ; PlanFragment insertFrag = null ; for ( PlanFragment f : insertStmt . getFragments ( ) ) insertFrag = f ; ParameterSet params = new ParameterSet ( ) ; params . m_params = new Object [ ] { 1L , 1L , 1L } ; VoltTable [ ] results = ee2 . executeQueryPlanFragmentsAndGetResults ( new long [ ] { CatalogUtil . getUniqueIdForFragment ( insertFrag ) } , 1 , new ParameterSet [ ] { params } , 1 , 1 , 0 , Long . MAX_VALUE ) ; assert ( results . length ) == 1 ; assert ( results [ 0 ] . asScalarLong ( ) ) == 1L ; params . m_params = new Object [ ] { 2L , 2L , 2L } ; results = ee1 . executeQueryPlanFragmentsAndGetResults ( new long [ ] { CatalogUtil . getUniqueIdForFragment ( insertFrag ) } , 1 , new ParameterSet [ ] { params } , 1 , 2 , 1 , Long . MAX_VALUE ) ; assert ( results . length ) == 1 ; assert ( results [ 0 ] . asScalarLong ( ) ) == 1L ; } public void testMultiSiteSelectAll ( ) { } }

Fix:
ee2 = new org . voltdb . jni . ExecutionEngineJNI ( site2 , cluster . getRelativeIndex ( ) , 2 , 1 , 0 , "" , 100 ) ;