Skip to content

Commit c7ce53c

Browse files
committed
8253440: serviceability/sa/TestJhsdbJstackLineNumbers.java failed with "Didn't find enough line numbers"
Backport-of: 0b1f57105d5af72b2cd47fa5c9a2b4e2961318cd
1 parent 6c82d9e commit c7ce53c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLineNumbers.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,6 +35,7 @@
3535

3636
/**
3737
* @test
38+
* @bug 8214226 8243500
3839
* @requires vm.hasSA
3940
* @requires os.arch=="amd64" | os.arch=="x86_64"
4041
* @requires os.family=="windows" | os.family == "linux" | os.family == "mac"
@@ -53,7 +54,7 @@
5354
*
5455
* The test works by spawning a process that sits in a 10 line loop in the busywork() method,
5556
* all while the main test does repeated jstacks on the process. The expectation is
56-
* that at least 5 of the lines in the busywork() loop will eventually show up in at
57+
* that at least 4 of the lines in the busywork() loop will eventually show up in at
5758
* least one of the jstack runs.
5859
*/
5960

@@ -94,8 +95,11 @@ public static void main(String... args) {
9495
public class TestJhsdbJstackLineNumbers {
9596
// This is the number of lines in the busywork main loop
9697
static final int TOTAL_BUSYWORK_LOOP_LINES = 10;
97-
// The minimum number of lines that we must at some point see in the jstack output
98-
static final int MIN_BUSYWORK_LOOP_LINES = 5;
98+
// The minimum number of lines that we must see at some point in the jstack output.
99+
// There's always a chance we could see fewer, but the chances are so low that
100+
// it is unlikely to ever happen. We can always decrease the odds by lowering
101+
// the required number of lines or increasing the number of jstack runs.
102+
static final int MIN_BUSYWORK_LOOP_LINES = 4;
99103

100104
static final int MAX_NUMBER_OF_JSTACK_RUNS = 25;
101105

0 commit comments

Comments
 (0)