Skip to content
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

chore(pd): refactor and fix pd tests #2492

Merged
merged 8 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/pd-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ jobs:
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-client-test

- name: Run cli-tools test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-cli-tools-test

- name: Run rest test
run: |
mvn test -pl hugegraph-pd/hg-pd-test -am -P pd-rest-test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,15 @@
try {
GraphCache graph = initGraph(graphName);
Partition partition = graph.getPartition(partId);
Shard shard = groups.get(partId).getValue();
if (partition == null || shard == null) {
if (partition == null) {
return null;
}
KVPair<ShardGroup, Shard> group = groups.get(partId);

Check warning on line 79 in hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/ClientCache.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/ClientCache.java#L79

Added line #L79 was not covered by tests
if (group == null) {
return null;

Check warning on line 81 in hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/ClientCache.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/ClientCache.java#L81

Added line #L81 was not covered by tests
}
Shard shard = group.getValue();

Check warning on line 83 in hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/ClientCache.java

View check run for this annotation

Codecov / codecov/patch

hugegraph-pd/hg-pd-client/src/main/java/org/apache/hugegraph/pd/client/ClientCache.java#L83

Added line #L83 was not covered by tests
if (shard == null) {
return null;
}
return new KVPair<>(partition, shard);
Expand Down
74 changes: 0 additions & 74 deletions hugegraph-pd/hg-pd-clitools/pom.xml

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class IdMetaStore extends MetadataRocksDBStore {
private static final String CID_DEL_SLOT_PREFIX = "@CID_DEL_SLOT@";
private static final String SEPARATOR = "@";
private static final ConcurrentHashMap<String, Object> SEQUENCES = new ConcurrentHashMap<>();
public static long CID_DEL_TIMEOUT = 24 * 3600 * 1000;
private static long CID_DEL_TIMEOUT = 24 * 3600 * 1000;
private final long clusterId;

public IdMetaStore(PDConfig pdConfig) {
Expand Down
6 changes: 0 additions & 6 deletions hugegraph-pd/hg-pd-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-clitools</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hg-pd-common</artifactId>
<version>${revision}</version>

</dependency>
<dependency>
<groupId>org.apache.hugegraph</groupId>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,18 @@

@RunWith(MockitoJUnitRunner.class)
public class BaseClientTest {
public static PDClient pdClient;
public final String storeAddr = "localhost";
public final String graphName = "default/hugegraph/g";
public long storeId = 0;

protected static PDClient pdClient;

@BeforeClass
public static void beforeClass() throws Exception {
public static void beforeClass() {
PDConfig config = PDConfig.of("localhost:8686");
// PDConfig config = PDConfig.of("10.81.116.77:8986");
config.setEnableCache(true);
pdClient = PDClient.create(config);
}

@After
public void teardown() throws Exception {
public void teardown() {
// pass
}
}
Loading
Loading