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

Using retryable operation to replace sleep to make tests stable #544

Closed
wants to merge 6 commits into from

Conversation

zymap
Copy link
Member

@zymap zymap commented Dec 29, 2021

Motivation

Using RunFuncWithTimeout to replace sleep operation to make
the tests are stable.


This PR is based on #541 , so please merge #641 at first.

@zymap zymap self-assigned this Dec 29, 2021
@zymap zymap requested a review from a team as a code owner December 29, 2021 07:43
@nodece
Copy link
Contributor

nodece commented Dec 30, 2021

@zymap Could you fix this CI and conflicts?

@zymap
Copy link
Member Author

zymap commented Dec 31, 2021

There are three tests still failed:

--- FAIL: TestDeleteNonExistingTopicSub (30.01s)
    delete_test.go:92: 
        	Error Trace:	delete_test.go:92
        	Error:      	Not equal: 
        	            	expected: "code: 404 reason: Topic not found"
        	            	actual  : "code: 500 reason: \n --- An unexpected error occurred in the server ---\n\nMessage: null\n\nStacktrace:\n\njava.lang.NullPointerException\n\tat org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44)\n\tat org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81)\n\tat org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3643)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalDeleteSubscriptionForNonPartitionedTopic(PersistentTopicsBase.java:1492)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalDeleteSubscription$77(PersistentTopicsBase.java:1475)\n\tat java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)\n\tat java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)\n\tat java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)\n\tat org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1,23 @@
        	            	-code: 404 reason: Topic not found
        	            	+code: 500 reason: 
        	            	+ --- An unexpected error occurred in the server ---
        	            	+
        	            	+Message: null
        	            	+
        	            	+Stacktrace:
        	            	+
        	            	+java.lang.NullPointerException
        	            	+	at org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44)
        	            	+	at org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81)
        	            	+	at org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3643)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalDeleteSubscriptionForNonPartitionedTopic(PersistentTopicsBase.java:1492)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalDeleteSubscription$77(PersistentTopicsBase.java:1475)
        	            	+	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
        	            	+	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        	            	+	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        	            	+	at org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158)
        	            	+	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        	            	+	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        	            	+	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        	            	+	at java.base/java.lang.Thread.run(Thread.java:829)
        	            	+
        	Test:       	TestDeleteNonExistingTopicSub


--- FAIL: TestResetCursorNonExistingTopic (30.00s)
    reset_cursor_test.go:63: 
        	Error Trace:	reset_cursor_test.go:63
        	Error:      	Not equal: 
        	            	expected: "code: 404 reason: Topic not found"
        	            	actual  : "code: 500 reason: \n --- An unexpected error occurred in the server ---\n\nMessage: null\n\nStacktrace:\n\njava.lang.NullPointerException\n\tat org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44)\n\tat org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81)\n\tat org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3643)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalResetCursorForNonPartitionedTopic(PersistentTopicsBase.java:1996)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalResetCursor$93(PersistentTopicsBase.java:1976)\n\tat java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)\n\tat java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)\n\tat java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)\n\tat org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1,23 @@
        	            	-code: 404 reason: Topic not found
        	            	+code: 500 reason: 
        	            	+ --- An unexpected error occurred in the server ---
        	            	+
        	            	+Message: null
        	            	+
        	            	+Stacktrace:
        	            	+
        	            	+java.lang.NullPointerException
        	            	+	at org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44)
        	            	+	at org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81)
        	            	+	at org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3643)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalResetCursorForNonPartitionedTopic(PersistentTopicsBase.java:1996)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalResetCursor$93(PersistentTopicsBase.java:1976)
        	            	+	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
        	            	+	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        	            	+	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        	            	+	at org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158)
        	            	+	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        	            	+	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        	            	+	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        	            	+	at java.base/java.lang.Thread.run(Thread.java:829)
        	            	+
        	Test:       	TestResetCursorNonExistingTopic

--- FAIL: TestCompactNonExistingTopic (30.02s)
    compact_test.go:60: 
        	Error Trace:	compact_test.go:60
        	Error:      	Not equal: 
        	            	expected: "code: 404 reason: Topic not found"
        	            	actual  : "code: 500 reason: \n --- An unexpected error occurred in the server ---\n\nMessage: null\n\nStacktrace:\n\njava.lang.NullPointerException\n\tat org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44)\n\tat org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81)\n\tat org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3643)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalTriggerCompactionNonPartitionedTopic(PersistentTopicsBase.java:3513)\n\tat org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalTriggerCompaction$156(PersistentTopicsBase.java:3493)\n\tat java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)\n\tat java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)\n\tat java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)\n\tat org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\n\tat java.base/java.lang.Thread.run(Thread.java:829)\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1,23 @@
        	            	-code: 404 reason: Topic not found
        	            	+code: 500 reason: 
        	            	+ --- An unexpected error occurred in the server ---
        	            	+
        	            	+Message: null
        	            	+
        	            	+Stacktrace:
        	            	+
        	            	+java.lang.NullPointerException
        	            	+	at org.apache.pulsar.broker.web.RestException.getExceptionData(RestException.java:44)
        	            	+	at org.apache.pulsar.broker.web.RestException.getResponse(RestException.java:81)
        	            	+	at org.apache.pulsar.broker.web.RestException.<init>(RestException.java:57)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.getTopicReference(PersistentTopicsBase.java:3643)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.internalTriggerCompactionNonPartitionedTopic(PersistentTopicsBase.java:3513)
        	            	+	at org.apache.pulsar.broker.admin.impl.PersistentTopicsBase.lambda$internalTriggerCompaction$156(PersistentTopicsBase.java:3493)
        	            	+	at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:714)
        	            	+	at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        	            	+	at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
        	            	+	at org.apache.pulsar.metadata.impl.ZKMetadataStore.lambda$null$7(ZKMetadataStore.java:158)
        	            	+	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        	            	+	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        	            	+	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        	            	+	at java.base/java.lang.Thread.run(Thread.java:829)
        	            	+
        	Test:       	TestCompactNonExistingTopic

@zymap
Copy link
Member Author

zymap commented Dec 31, 2021

They are fixing at pulsar side: apache/pulsar#13551

@zymap
Copy link
Member Author

zymap commented Jan 21, 2022

Same fix with #555, close this PR

@zymap zymap closed this Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants