-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait for config volume to be ready #4835
Changes from all commits
5556cf8
eb2d145
667ba9b
f1be721
f03a20b
ede7822
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,20 +155,6 @@ public void testCreateDbPersistenceWithoutSetupDatabase() throws Exception { | |
dbPersistence.dumpConfigs()); | ||
} | ||
|
||
@Test | ||
public void testCreateFileSystemConfigPersistence() throws Exception { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why delete this test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. makes sense! |
||
Path testRoot = Path.of("/tmp/cpf_test_file_system"); | ||
Path rootPath = Files.createTempDirectory(Files.createDirectories(testRoot), ConfigPersistenceBuilderTest.class.getName()); | ||
ConfigPersistence seedPersistence = new FileSystemConfigPersistence(rootPath); | ||
writeSource(seedPersistence, SOURCE_GITHUB); | ||
writeDestination(seedPersistence, DESTINATION_S3); | ||
|
||
when(configs.getConfigRoot()).thenReturn(rootPath); | ||
|
||
ConfigPersistence filePersistence = new ConfigPersistenceBuilder(configs, false).getFileSystemPersistence(); | ||
assertSameConfigDump(seedPersistence.dumpConfigs(), filePersistence.dumpConfigs()); | ||
} | ||
|
||
/** | ||
* This test mimics the file -> db config persistence migration process. | ||
*/ | ||
|
@@ -187,10 +173,11 @@ public void testMigrateFromFileToDbPersistence() throws Exception { | |
|
||
// first run uses file system config persistence, and adds an extra workspace | ||
Path testRoot = Path.of("/tmp/cpf_test_migration"); | ||
Path rootPath = Files.createTempDirectory(Files.createDirectories(testRoot), ConfigPersistenceBuilderTest.class.getName()); | ||
when(configs.getConfigRoot()).thenReturn(rootPath); | ||
Path storageRoot = Files.createTempDirectory(Files.createDirectories(testRoot), ConfigPersistenceBuilderTest.class.getName()); | ||
Files.createDirectories(storageRoot.resolve(FileSystemConfigPersistence.CONFIG_DIR)); | ||
when(configs.getConfigRoot()).thenReturn(storageRoot); | ||
|
||
ConfigPersistence filePersistence = new ConfigPersistenceBuilder(configs, false).getFileSystemPersistence(); | ||
ConfigPersistence filePersistence = FileSystemConfigPersistence.createWithValidation(storageRoot); | ||
|
||
filePersistence.replaceAllConfigs(seedConfigs, false); | ||
filePersistence.writeConfig(ConfigSchema.STANDARD_WORKSPACE, extraWorkspace.getWorkspaceId().toString(), extraWorkspace); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added by me in #4670. But I should not have done that. This statement covered the corner case that sometimes the config volume is not ready when server app starts, at least in kube acceptance test.