Skip to content

Commit

Permalink
Spark 3.5: Fix flaky TestSparkExecutorCache (#9583)
Browse files Browse the repository at this point in the history
  • Loading branch information
aokolnychyi authored Jan 31, 2024
1 parent a25f77d commit f8866bf
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@
import org.apache.iceberg.spark.SparkExecutorCache.Conf;
import org.apache.iceberg.util.CharSequenceSet;
import org.apache.iceberg.util.Pair;
import org.apache.spark.SparkEnv;
import org.apache.spark.sql.Dataset;
import org.apache.spark.sql.Encoders;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.catalyst.analysis.NoSuchTableException;
import org.apache.spark.storage.memory.MemoryStore;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestTemplate;
Expand Down Expand Up @@ -391,6 +393,11 @@ private List<DeleteFile> createAndInitTable(String operation, RowLevelOperationM

sql("REFRESH TABLE %s", targetTableName);

// invalidate the memory store to destroy all currently live table broadcasts
SparkEnv sparkEnv = SparkEnv.get();
MemoryStore memoryStore = sparkEnv.blockManager().memoryStore();
memoryStore.clear();

return ImmutableList.of(posDeleteFile, eqDeleteFile);
}

Expand Down

0 comments on commit f8866bf

Please sign in to comment.