Reduce Test Times from Slow Tests#31954
Conversation
|
API change check API changes are not detected in this pull request. |
|
Thanks @alzimmermsft |
|
/check-enforcer override |
|
Overriding check enforcer as all tests passed and no linting changes were made |
| } else if (getTestMode() == TestMode.PLAYBACK) { | ||
| ledgerManager = ConfidentialLedgerManager | ||
| .configure() | ||
| .withDefaultPollInterval(Duration.ofMillis(10)) |
There was a problem hiding this comment.
Thanks.
... one more reason to avoid RECORD test. (these mgmt lib generally only do live tests, ran before release)
There was a problem hiding this comment.
@alzimmermsft It occured to me that DPG lib might have LRO tests as well. How does data-plane handle it?
There was a problem hiding this comment.
Many of the data-plane tests end up having a method for setting the poll interval based on playback or live testing but there are methods available on TestBase which handle setting this: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-test/src/main/java/com/azure/core/test/TestBase.java#L286
Ideally, those would be used more often.
There was a problem hiding this comment.
I see, so "setPlaybackSyncPollerPollInterval" should be called after getting the SyncPoller and before calling it to get final result, by dev in test code. Is it correct?
If so, I will update to the guide for DPG on test section.
PS: But from impl, it seems "RetryAfter" from response still take precedence over "pollInterval"? https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core/src/main/java/com/azure/core/util/polling/PollingUtil.java#L101-L110
| @DoNotRecord(skipInPlayback = true) | ||
| public void testCloneVirtualMachineToNewRegion() { | ||
| Assertions.assertTrue(CloneVirtualMachineToNewRegion.runSample(azureResourceManager)); | ||
| } |
There was a problem hiding this comment.
@XiaofeiCao Please check why PLAYBACK is slow. Should use ResourceManagerUtils.getDelayDuration for any duration in code.
There was a problem hiding this comment.
@XiaofeiCao Also please check if JUnit can have a global setting for timeout for each test case (e.g. set it to 5 sec per test, enabled only at PLAYBACK).
There was a problem hiding this comment.
Got it, The issue is that I did not use the ResourceManagerUtils.getDelayDuration in waitForCopyStartCompletion.
Sorry for that.. Will look into it.
Description
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines