Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhoon committed Nov 28, 2023
1 parent 5998a2f commit 44c2a46
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,18 @@ static void setUp() {
executor.execute(Command.createRepository(Author.SYSTEM, TEST_PRJ, TEST_REPO)).join();
executor.execute(Command.createRepository(Author.SYSTEM, TEST_PRJ, TEST_REPO2)).join();
executor.execute(Command.createRepository(Author.SYSTEM, TEST_PRJ, TEST_REPO3)).join();

final MetadataService mds = new MetadataService(extension.projectManager(), executor);
// Metadata should be created before entering read-only mode.
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO).join();
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO2).join();
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO3).join();
}

@Test
void setWriteQuota() {
final StandaloneCommandExecutor executor = (StandaloneCommandExecutor) extension.executor();
final MetadataService mds = new MetadataService(extension.projectManager(), executor);
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO).join();

final RateLimiter rateLimiter1 = executor.writeRateLimiters.get("test_prj/test_repo");
assertThat(rateLimiter1).isNull();
Expand Down Expand Up @@ -122,12 +127,6 @@ void jsonUpsertPushCommandConvertedIntoJsonPatchWhenApplicable() {
@Test
void shouldPerformAdministrativeCommandWithReadOnly() throws JsonParseException {
final StandaloneCommandExecutor executor = (StandaloneCommandExecutor) extension.executor();
final MetadataService mds = new MetadataService(extension.projectManager(), executor);
// Metadata should be created before entering read-only mode.
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO).join();
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO2).join();
mds.addRepo(Author.SYSTEM, TEST_PRJ, TEST_REPO3).join();

executor.execute(Command.updateServerStatus(false)).join();
assertThat(executor.isWritable()).isFalse();

Expand Down

0 comments on commit 44c2a46

Please sign in to comment.