GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [improve][test] Replace timeout waits in 11 slow, low-CPU unit-test classes by merlimat · Pull Request #27537 · apache/pulsar Conversation
Contributor
ProblemEleven unit-test classes take long in CI but use little CPU: they mostly wait for timeouts to run out. Measured with
Example// MetadataStoreTableViewTest.notificationListeners: no tail item for a filtered key tv.put(noListenKey, val0).join(); kv = tails.poll(3, TimeUnit.SECONDS); // always waits the full 3 s assertNull(kv); // ProxyRolesEnforcementTest.testIncorrectRoles: the broker rejects the connection; the client logs // "Could not get connection while getting partitioned topic metadata, will retry" until the 30 s operation timeout try (PulsarClient proxyClient = createPulsarClient(pulsar.getBrokerServiceUrl(), proxyAuthParams)) { try { proxyClient.newConsumer().topic(topicName).subscriptionName(subscriptionName).subscribe(); } catch (Exception ex) { exceptionOccurred = true; } // CompactionTest.testDeleteCompactedLedgerWithSlowAck: the stub is never invoked Mockito.doAnswer(...).when(subscription).acknowledgeMessage(Mockito.any(), Mockito.eq( CommandAck.AckType.Cumulative), Mockito.any()); compactionAckedLatch.await(9, TimeUnit.SECONDS); // result ignored, always times out ChangeNegative checks become marker checks, keeping what they prove.
Expected failures get short timeouts on the call that must fail.
Shorter delays, still longer than what they must outlast.
Fewer throttled messages. The slow-ack race now runs. Testing
That's about 495 s less class time per CI run. All tests pass in every run.
Not changed here:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…lasses - MetadataStoreTableViewTest: the checks that no other tail item arrives waited 3 s each. They now write a marker key through the store and expect its tail item next. The existing-item check needs no wait, since start() returns after the fill has called the listeners. The concurrent-put workers stop on the last value instead of a 3 s idle poll. - MetadataStoreBatchingTest: a 50 ms batching delay instead of 1 s, which every operation waited for. - LedgerUnderreplicationManagerTest: the ambiguous-delete close row waits for a 1 s close timeout instead of the 30 s default. - CompactionTest: the last "nothing else arrives" receive of 14 tests waited 2-10 s for a null message. They now publish a marker and expect it to be the next message. testBrokerRestartAfterCompaction's subscribe to the stopped broker uses a client with a 2 s operation timeout instead of the default 30 s. testDeleteCompactedLedgerWithSlowAck stubbed the deprecated sync acknowledgeMessage, which the broker no longer calls, so its latch always ran out after 9 s and the slow-ack race never ran: it now stubs acknowledgeMessageAsync and asserts the latch. - ReaderTest: the 10 s readNext calls expecting null after a seek now read a marker; no fixed 3 s poll delay before a positive condition; a 100 ms timeout for each create against a bad URL instead of 1 s. - UnAcknowledgedMessagesTimeoutTest: the redelivery-timer variations use the 1 s minimum ack timeout and 100-900 ms backoffs instead of 2-3 s timeouts and 1-3 s backoffs. …ree Client Api test classes - TokenExpirationProduceConsumerTest: a 5 s token instead of 20 s, a 2 s send timeout, so that the expected TimeoutException doesn't wait for the default 30 s, and a 500 ms poll interval instead of 3 s. - OrphanPersistentTopicTest: a 1 s topic load timeout with 2 s injected delays instead of 2-5 s timeouts and 4-10 s delays. The delays still outlast the timeout, as each test needs. - MessagePublishThrottlingTest: send 40 messages instead of 100-200 at 10 msg/s or 400 bytes/s, and 30 instead of 40 in the broker and topic byte-throttling test. That's still more than twice the limit, so each rate check keeps its margin. …d ReplicationTopicGcTest - ProxyRolesEnforcementTest: the two clients whose connection the broker rejects retried until the default 30 s operation timeout before the expected subscribe failure. They now have a 2 s operation timeout. - ReplicationTopicGcTest: the inactive-topic GC runs every second, and topics and replicators count as inactive after 2 s instead of 5 s.
codelipenghui
approved these changes
…wait-fixes # Conflicts: # pulsar-broker/src/test/java/org/apache/pulsar/client/api/OrphanPersistentTopicTest.java # pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessagePublishThrottlingTest.java
codelipenghui
approved these changes
…wait-fixes # Conflicts: # pulsar-broker/src/test/java/org/apache/pulsar/client/api/TokenExpirationProduceConsumerTest.java # pulsar-metadata/src/test/java/org/apache/pulsar/metadata/bookkeeper/LedgerUnderreplicationManagerTest.java # pulsar-proxy/src/test/java/org/apache/pulsar/proxy/server/ProxyRolesEnforcementTest.java
codelipenghui
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |