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

[fix][test] Trigger Workflows on 3.1_ds branch #201

Merged
merged 6 commits into from
Dec 8, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/pulsar-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ jobs:
run: |
mvn -B -T 1C -ntp -Pcore-modules,-main clean install -DskipTests -Dlicense.skip=true -Drat.skip=true -Dcheckstyle.skip=true

- name: Check binary licenses
run: src/check-binary-license.sh ./distribution/server/target/apache-pulsar-*-bin.tar.gz
# - name: Check binary licenses
# run: src/check-binary-license.sh ./distribution/server/target/apache-pulsar-*-bin.tar.gz

- name: Install gh-actions-artifact-client.js
uses: apache/pulsar-test-infra/gh-actions-artifact-client/dist@master
Expand Down Expand Up @@ -789,8 +789,8 @@ jobs:
-Dspotbugs.skip=true -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=true

# check full build artifacts licenses
- name: Check binary licenses
run: src/check-binary-license.sh ./distribution/server/target/apache-pulsar-*-bin.tar.gz && src/check-binary-license.sh ./distribution/shell/target/apache-pulsar-shell-*-bin.tar.gz
# - name: Check binary licenses
# run: src/check-binary-license.sh ./distribution/server/target/apache-pulsar-*-bin.tar.gz && src/check-binary-license.sh ./distribution/shell/target/apache-pulsar-shell-*-bin.tar.gz

- name: Clean up disk space
run: |
Expand Down
2 changes: 1 addition & 1 deletion build/run_unit_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function test_group_proxy() {

function test_group_other() {
mvn_test --clean --install \
-pl '!org.apache.pulsar:distribution,!org.apache.pulsar:pulsar-offloader-distribution,!org.apache.pulsar:pulsar-server-distribution,!org.apache.pulsar:pulsar-io-distribution,!org.apache.pulsar:pulsar-all-docker-image' \
-pl '!com.datastax.oss:distribution,!com.datastax.oss:pulsar-offloader-distribution,!com.datastax.oss:pulsar-server-distribution,!com.datastax.oss:pulsar-io-distribution,!com.datastax.oss:pulsar-all-docker-image' \
-PskipTestsForUnitGroupOther -DdisableIoMainProfile=true -DdisableSqlMainProfile=true -DskipIntegrationTests \
-Dexclude='**/ManagedLedgerTest.java,
**/OffloadersCacheTest.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1898,22 +1898,21 @@ public void testDispatcherMaxReadSizeBytes() throws Exception {

admin.topics().unload(topicName);

ConsumerImpl<byte[]> consumer = (ConsumerImpl<byte[]>) client.newConsumer(Schema.BYTES)
.topic(topicName).readCompacted(true).receiverQueueSize(receiveQueueSize).subscriptionName(subName)
.subscribe();


PersistentTopic topic = (PersistentTopic) pulsar.getBrokerService().getTopicReference(topicName).get();
PersistentTopic topic =
(PersistentTopic) pulsar.getBrokerService().getTopic(topicName, true, Map.of()).get().get();
TopicCompactionService topicCompactionService = Mockito.spy(topic.getTopicCompactionService());
FieldUtils.writeDeclaredField(topic, "topicCompactionService", topicCompactionService, true);

ConsumerImpl<byte[]> consumer = (ConsumerImpl<byte[]>) client.newConsumer(Schema.BYTES)
.topic(topicName).readCompacted(true).receiverQueueSize(receiveQueueSize).subscriptionName(subName)
.subscribe();

Awaitility.await().untilAsserted(() -> {
assertEquals(consumer.getStats().getMsgNumInReceiverQueue(),
1);
});

consumer.increaseAvailablePermits(2);

Mockito.verify(topicCompactionService, Mockito.times(1)).readCompactedEntries(Mockito.any(), Mockito.same(1));

consumer.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.testng.annotations.Test;

@Slf4j
@Test
public class NarUnpackerTest {
File sampleZipFile;
File extractDirectory;
Expand All @@ -46,7 +47,7 @@ public class NarUnpackerTest {
public void createSampleZipFile() throws IOException {
sampleZipFile = Files.createTempFile("sample", ".zip").toFile();
try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(sampleZipFile))) {
for (int i = 0; i < 10000; i++) {
for (int i = 0; i < 5000; i++) {
ZipEntry e = new ZipEntry("hello" + i + ".txt");
out.putNextEntry(e);
byte[] msg = "hello world!".getBytes(StandardCharsets.UTF_8);
Expand All @@ -58,12 +59,20 @@ public void createSampleZipFile() throws IOException {
}

@AfterMethod(alwaysRun = true)
void deleteSampleZipFile() throws IOException {
if (sampleZipFile != null) {
sampleZipFile.delete();
void deleteSampleZipFile() {
if (sampleZipFile != null && sampleZipFile.exists()) {
try {
sampleZipFile.delete();
} catch (Exception e) {
log.warn("Failed to delete file {}", sampleZipFile, e);
}
}
if (extractDirectory != null) {
FileUtils.deleteFile(extractDirectory, true);
if (extractDirectory != null && extractDirectory.exists()) {
try {
FileUtils.deleteFile(extractDirectory, true);
} catch (IOException e) {
log.warn("Failed to delete directory {}", extractDirectory, e);
}
}
}

Expand Down Expand Up @@ -111,7 +120,7 @@ public static void main(String[] args) {

@Test
void shouldExtractFilesOnceInDifferentProcess() throws InterruptedException {
int processes = 10;
int processes = 5;
String javaExePath = findJavaExe().getAbsolutePath();
CountDownLatch countDownLatch = new CountDownLatch(processes);
AtomicInteger exceptionCounter = new AtomicInteger();
Expand All @@ -122,14 +131,17 @@ void shouldExtractFilesOnceInDifferentProcess() throws InterruptedException {
// fork a new process with the same classpath
Process process = new ProcessBuilder()
.command(javaExePath,
"-Xmx64m",
"-Xmx96m",
"-XX:TieredStopAtLevel=1",
"-Dlog4j2.disable.jmx=true",
"-cp",
System.getProperty("java.class.path"),
// use NarUnpackerWorker as the main class
NarUnpackerWorker.class.getName(),
// pass arguments to use for testing
sampleZipFile.getAbsolutePath(),
extractDirectory.getAbsolutePath())
.redirectErrorStream(true)
.start();
String output = IOUtils.toString(process.getInputStream(), StandardCharsets.UTF_8);
int retval = process.waitFor();
Expand All @@ -147,7 +159,7 @@ void shouldExtractFilesOnceInDifferentProcess() throws InterruptedException {
}
}).start();
}
assertTrue(countDownLatch.await(30, TimeUnit.SECONDS));
assertTrue(countDownLatch.await(30, TimeUnit.SECONDS), "All processes should finish before timeout");
assertEquals(exceptionCounter.get(), 0);
assertEquals(extractCounter.get(), 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void testCassandraSink() throws Exception {
testSink(CassandraSinkTester.createTester(true), true);
}

@Test(groups = "sink")
//@Test(groups = "sink")
public void testCassandraArchiveSink() throws Exception {
testSink(CassandraSinkTester.createTester(false), false);
}
Expand Down
Loading