8335684: Test ThreadCpuTime.java should pause like ThreadCpuTimeArray.java

Reviewed-by: sspitsyn, cjplummer
This commit is contained in:
Kevin Walls 2024-07-12 17:11:20 +00:00
parent 84c74ad0a9
commit 1f6e106b45

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -177,6 +177,8 @@ public class ThreadCpuTime {
}
}
}
// Account for threads using CPU for a few millis after their WAITING state is visible:
goSleep(500);
}
static class MyThread extends Thread {
@ -228,15 +230,6 @@ public class ThreadCpuTime {
" CurrentThreadCpuTime = " + time1 +
" > ThreadCpuTime = " + time2);
}
/*************
* FIXME: Seems that on Solaris-sparc,
* It occasionally returns a different current thread user time > thread user time
if (utime1 > utime2) {
throw new RuntimeException("TEST FAILED: " + getName() +
" CurrentThreadUserTime = " + utime1 +
" > ThreadUserTime = " + utime2);
}
*/
}
}