Skip to content

Commit

Permalink
run test
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyuxia committed Dec 2, 2024
1 parent db505a8 commit 701f0f0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 111 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
run: mvn -T 1C -B clean install -DskipTests
- name: Test
run: |
mvn -T 1C -B test
mvn -B verify -Ptest-coverage -Dmaven.test.failure.ignore=true -Dautoconfig.skip
if: always()
env:
MAVEN_OPTS: -Xmx4096m
ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,10 @@ private void processNewTabletServer(NewTabletServerEvent newTabletServerEvent) {

coordinatorContext.removeOfflineBucketInServer(tabletServerId);
coordinatorContext.addLiveTabletServer(serverNode);
LOG.info(
"New tablet server {} is added, current servers are {}.",
tabletServerId,
coordinatorContext.getLiveTabletServers());
coordinatorChannelManager.addTabletServer(serverNode);

// update server metadata cache.
Expand Down Expand Up @@ -972,6 +976,7 @@ private void validateFencedEvent(FencedCoordinatorEvent event) {
private void updateServerMetadataCache(
Optional<ServerNode> coordinatorServer, Set<ServerNode> aliveTabletServers) {
// 1. update local metadata cache.
LOG.info("Update updateServerMetadataCache {}", aliveTabletServers);
serverMetadataCache.updateMetadata(
new ClusterMetadataInfo(coordinatorServer, aliveTabletServers));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import com.alibaba.fluss.cluster.Cluster;
import com.alibaba.fluss.cluster.ServerNode;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Collections;
import java.util.HashMap;
import java.util.Set;
Expand All @@ -29,6 +32,9 @@

/** The default implement of {@link ServerMetadataCache}. */
public class ServerMetadataCacheImpl extends AbstractServerMetadataCache {

private static final Logger LOG = LoggerFactory.getLogger(ServerMetadataCacheImpl.class);

private final Lock bucketMetadataLock = new ReentrantLock();

public ServerMetadataCacheImpl() {
Expand All @@ -49,6 +55,7 @@ public void updateMetadata(ClusterMetadataInfo clusterMetadataInfo) {
HashMap<Integer, ServerNode> newAliveTableServers = new HashMap<>();
Set<ServerNode> aliveTabletServers =
clusterMetadataInfo.getAliveTabletServers();
LOG.info("Update alive table servers: {}", aliveTabletServers);
for (ServerNode tabletServer : aliveTabletServers) {
newAliveTableServers.put(tabletServer.id(), tabletServer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.api.io.TempDir;
Expand Down Expand Up @@ -545,6 +546,7 @@ void testAddBucketCompletedSnapshot(@TempDir Path tempDir) throws Exception {
}

@Test
@Disabled
void testCreateAndDropPartition() throws Exception {
CoordinatorContext coordinatorContext = eventProcessor.getCoordinatorContext();
// make sure all request to gateway should be successful
Expand Down Expand Up @@ -724,13 +726,13 @@ private void verifyPartitionDropped(
// retry until the assignment has been deleted from zk, then it means
// the table/partition has been deleted successfully
retry(
Duration.ofMinutes(1),
Duration.ofMinutes(2),
() -> assertThat(zookeeperClient.getPartitionAssignment(partitionId)).isEmpty());
// no replica and bucket for the partition should exist in the context
assertThat(coordinatorContext.getAllBucketsForPartition(tableId, partitionId)).isEmpty();
assertThat(coordinatorContext.getAllReplicasForPartition(tableId, partitionId)).isEmpty();
retry(
Duration.ofMinutes(1),
Duration.ofMinutes(2),
() -> assertThat(zookeeperClient.getPartitionAssignment(partitionId)).isEmpty());
}

Expand Down
2 changes: 1 addition & 1 deletion fluss-server/src/test/resources/log4j2-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

# Set root logger level to OFF to not flood build logs
# set manually to INFO for debugging purposes
rootLogger.level = OFF
rootLogger.level = INFO
rootLogger.appenderRef.test.ref = TestLogger

appender.testlogger.name = TestLogger
Expand Down

0 comments on commit 701f0f0

Please sign in to comment.