File tree 1 file changed +13
-5
lines changed
test/hotspot/jtreg/serviceability/sa
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2018, 2019 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2018, 2022 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
25
25
import java .util .List ;
26
26
import java .util .Map ;
27
27
import jdk .test .lib .apps .LingeredApp ;
28
+ import jdk .test .lib .Platform ;
28
29
import jtreg .SkippedException ;
29
30
30
31
/**
@@ -96,10 +97,17 @@ public static void main(String[] args) throws Exception {
96
97
System .out .println ("Thread Id obtained is: " + threadIdObtained );
97
98
98
99
String cmd = "thread " + threadIdObtained ;
99
- expStrMap .put (cmd , List .of (
100
- "Base of Stack:" ,
101
- "State:" ,
102
- "Last_Java_SP" ));
100
+ if (Platform .isWindows ()) {
101
+ // On windows thread IDs are not guaranteed to be the same each time you attach,
102
+ // so the ID we gleaned above for the Finalizer thread may not actually be for
103
+ // the Finalizer thread when we attach for the following "thread" command, so we
104
+ // choose not to check the result on Windows.
105
+ } else {
106
+ expStrMap .put (cmd , List .of (
107
+ "Base of Stack:" ,
108
+ "State:" ,
109
+ "Last_Java_SP" ));
110
+ }
103
111
cmds = List .of (cmd );
104
112
test .run (theApp .getPid (), cmds , expStrMap , null );
105
113
} catch (SkippedException se ) {
You can’t perform that action at this time.
0 commit comments