Skip to content

Commit 213a6a3

Browse files
authored
Update submodule (#1916)
* Update submodule * Try to fix one branch build * Fix sporadic test failure * Fix another sporadic failure * Metaspace
1 parent c0d9719 commit 213a6a3

File tree

7 files changed

+20
-33
lines changed

7 files changed

+20
-33
lines changed

.pipelines/pipeline.user.windows.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,16 @@ restore:
3838
- !!defaultcommand
3939
name: 'Install Java 11 JDK'
4040
command: '.scripts/installJava11jdk.cmd'
41-
- !!defaultcommand
42-
name: 'Add OpenTelemetry to MavenLocal (pre-1)'
43-
command: '.scripts/ot-gradle.cmd'
44-
arguments: '--project-dir gradle-plugins publishToMavenLocal'
45-
- !!defaultcommand
46-
name: 'Add OpenTelemetry to MavenLocal (pre-2)'
47-
command: '.scripts/ot-gradle.cmd'
48-
arguments: ':muzzle:publishToMavenLocal'
4941
- !!defaultcommand
5042
name: 'Add OpenTelemetry to MavenLocal'
5143
command: '.scripts/ot-gradle.cmd'
5244
# javadoc fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
5345
arguments: 'publishToMavenLocal -x javadoc'
46+
# if connection reset issue continues, try:
47+
# -P org.gradle.internal.http.connectionTimeout=30000
48+
# -P org.gradle.internal.http.socketTimeout=30000
49+
# -P org.gradle.internal.repository.max.retries=10
50+
# -P org.gradle.internal.repository.initial.backoff=500
5451
- !!defaultcommand
5552
name: 'Download Dependencies'
5653
command: '.scripts/gradle.cmd'

.scripts/ot-gradle.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ set PROJECT_ROOT=%CD%\otel
1111
pushd %PROJECT_ROOT%
1212

1313
set DEFAULT_OPTIONS=--info --stacktrace --warning-mode=all
14+
rem one branch build has been getting sporadic metaspace out of memory errors
15+
set GRADLE_OPTS=-XX:MaxMetaspaceSize=768m
1416
set GRADLE_CMD=gradlew.bat %DEFAULT_OPTIONS% %*
1517
echo Running '%GRADLE_CMD%' in '%PROJECT_ROOT%'
1618
call %GRADLE_CMD%

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
// Project properties
22
version=3.2.1-BETA
3-
group=com.microsoft.azure
3+
group=com.microsoft.azure
4+
5+
# gradle default is 256m which causes sporadic failures - https://docs.gradle.org/current/userguide/build_environment.html#sec:configuring_jvm_memory
6+
org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m

test/smoke/framework/testCore/src/main/java/com/microsoft/applicationinsights/smoketest/AiSmokeTest.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ protected static void stopContainer(ContainerInfo info) throws Exception {
188188
protected String httpMethod;
189189
protected long targetUriDelayMs;
190190
protected long targetUriCallCount;
191-
protected long targetUriTimeoutMs;
192191
// endregion
193192

194193
// region: options
@@ -220,7 +219,6 @@ protected void starting(Description description) {
220219
thiz.httpMethod = null;
221220
thiz.targetUriDelayMs = 0L;
222221
thiz.targetUriCallCount = 1;
223-
thiz.targetUriTimeoutMs = TELEMETRY_RECEIVE_TIMEOUT_SECONDS * 1000;
224222
} else {
225223
thiz.targetUri = targetUri.value();
226224
if (!thiz.targetUri.startsWith("/")) {
@@ -229,10 +227,6 @@ protected void starting(Description description) {
229227
thiz.httpMethod = targetUri.method().toUpperCase();
230228
thiz.targetUriDelayMs = targetUri.delay();
231229
thiz.targetUriCallCount = targetUri.callCount();
232-
thiz.targetUriTimeoutMs =
233-
targetUri.timeout() > 0
234-
? targetUri.timeout()
235-
: TELEMETRY_RECEIVE_TIMEOUT_SECONDS * 1000;
236230
}
237231
}
238232

@@ -491,12 +485,10 @@ protected void callTargetUriAndWaitForTelemetry() throws Exception {
491485
String.format("Empty response from targetUri: '%s'. %s", targetUri, expectationMessage),
492486
content.length() > 0);
493487
}
494-
if (this.targetUriTimeoutMs > 0) {
495-
Stopwatch sw = Stopwatch.createStarted();
496-
mockedIngestion.awaitAnyItems(this.targetUriTimeoutMs, TimeUnit.MILLISECONDS);
497-
System.out.printf(
498-
"Telemetry received after %.3f seconds.%n", sw.elapsed(TimeUnit.MILLISECONDS) / 1000.0);
499-
}
488+
Stopwatch sw = Stopwatch.createStarted();
489+
mockedIngestion.awaitAnyItems(TELEMETRY_RECEIVE_TIMEOUT_SECONDS * 1000, TimeUnit.MILLISECONDS);
490+
System.out.printf(
491+
"Telemetry received after %.3f seconds.%n", sw.elapsed(TimeUnit.MILLISECONDS) / 1000.0);
500492
System.out.println("Starting validation...");
501493
assertTrue("mocked ingestion has no data", mockedIngestion.hasData());
502494
}

test/smoke/framework/testCore/src/main/java/com/microsoft/applicationinsights/smoketest/TargetUri.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@
3838

3939
/** The number of times to call the target uri. */
4040
int callCount() default 1;
41-
42-
/** The number of milliseconds to wait for a response. */
43-
long timeout() default 0L;
4441
}

test/smoke/testApps/CoreAndFilter/src/smokeTest/java/com/microsoft/applicationinsights/smoketest/CoreAndFilterTests.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,19 +412,15 @@ public void testAutoFailedRequestWithResultCode() throws Exception {
412412
}
413413

414414
@Test
415-
@TargetUri(
416-
value = "/requestSlow?sleeptime=25",
417-
timeout = 35_000) // the servlet sleeps for 25 seconds
415+
@TargetUri("/requestSlow?sleeptime=20")
418416
public void testRequestSlowWithResponseTime() throws Exception {
419-
validateSlowTest(25, "GET /CoreAndFilter/requestSlow");
417+
validateSlowTest(20, "GET /CoreAndFilter/requestSlow");
420418
}
421419

422420
@Test
423-
@TargetUri(
424-
value = "/slowLoop?responseTime=25",
425-
timeout = 35_000) // the servlet sleeps for 20 seconds
421+
@TargetUri("/slowLoop?responseTime=20")
426422
public void testSlowRequestUsingCpuBoundLoop() throws Exception {
427-
validateSlowTest(25, "GET /CoreAndFilter/slowLoop");
423+
validateSlowTest(20, "GET /CoreAndFilter/slowLoop");
428424
}
429425

430426
@Test

0 commit comments

Comments
 (0)