File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
smoke-tests/framework/src/main/java/com/microsoft/applicationinsights/smoketest Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 66import static org .assertj .core .api .Assertions .assertThat ;
77import static org .awaitility .Awaitility .await ;
88import static org .junit .Assert .assertEquals ;
9+ import static org .junit .jupiter .api .Assertions .assertTrue ;
910
1011import com .google .common .base .Stopwatch ;
1112import com .microsoft .applicationinsights .smoketest .fakeingestion .MockedAppInsightsIngestionServer ;
5556@ SuppressWarnings ({"SystemOut" , "InterruptedExceptionSwallowed" })
5657public class SmokeTestExtension
5758 implements BeforeAllCallback ,
58- BeforeEachCallback ,
59- AfterAllCallback ,
60- AfterEachCallback ,
61- TestWatcher {
59+ BeforeEachCallback ,
60+ AfterAllCallback ,
61+ AfterEachCallback ,
62+ TestWatcher {
6263
6364 // add -PsmokeTestRemoteDebug=true to the gradle args to enable (see ai.smoke-test.gradle.kts)
6465 private static final boolean REMOTE_DEBUG = Boolean .getBoolean ("ai.smoke-test.remote-debug" );
@@ -280,6 +281,10 @@ protected String getAppContext() {
280281 }
281282
282283 private void clearOutAnyInitLogs () throws Exception {
284+ // ensure live metrics is ready
285+ await ().untilAsserted (() -> assertTrue (mockedIngestion .isPingReceived ()));
286+ await ().untilAsserted (() -> assertThat (mockedIngestion .getPostBodies ()).isNotEmpty ());
287+
283288 if (!skipHealthCheck ) {
284289 String contextRootUrl = getBaseUrl () + "/" ;
285290 HttpHelper .getResponseCodeEnsuringSampled (contextRootUrl );
You can’t perform that action at this time.
0 commit comments