HeartSaVioR commented on code in PR #36242:
URL: https://github.com/apache/spark/pull/36242#discussion_r852505881
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala:
##########
@@ -168,6 +168,22 @@ class RocksDBSuite extends SparkFunSuite {
}
}
+ test("RocksDBFileManager: create init dfs directory with unknown number of
keys") {
+ val dfsRootDir = new File(Utils.createTempDir().getAbsolutePath +
"/state/1/1")
+ try {
+ val fileManager = new RocksDBFileManager(
+ dfsRootDir.getAbsolutePath, Utils.createTempDir(), new Configuration)
+ // Save a version of empty checkpoint files
+ val cpFiles = Seq()
+ assert(!dfsRootDir.exists())
+ saveCheckpointFiles(fileManager, cpFiles, version = 1, numKeys = -1)
Review Comment:
In majority of cases we do symmetric test - if you save checkpoint for
verification, you are encouraged to load the checkpoint just you saved to
verify it completely.
This is already something like acceptance test, not pure unit test. You can
do the specific check to verify the part of your fix and say that could cover
your fix like pure unit test, but then you really want to do pure unit test,
not from RocksDBSuite but from RocksDBFileManagerSuite, specifically testing
`fileManager.saveCheckpointToDfs`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]