From dd0dcc870d9fe6cb9b7139b5e83b97804b1f68f9 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 9 Aug 2008 16:30:05 +0000 Subject: [PATCH] avoid the racing condition --- bindings/java/src/org/hyperic/sigar/test/TestProcStat.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bindings/java/src/org/hyperic/sigar/test/TestProcStat.java b/bindings/java/src/org/hyperic/sigar/test/TestProcStat.java index c201d940..622f1a4f 100644 --- a/bindings/java/src/org/hyperic/sigar/test/TestProcStat.java +++ b/bindings/java/src/org/hyperic/sigar/test/TestProcStat.java @@ -37,12 +37,7 @@ public class TestProcStat extends SigarTestCase { long[] pids = sigar.getProcList(); - //oh-no a racing condition! - //possible for this test to fail under normal - //conditions if the process table changes in between. - //if this is a real problem, can just change to: - //assertTrue(stat.getTotal() > 1); - assertTrue(pids.length == stat.getTotal()); + assertTrue(stat.getTotal() > 1); traceln(stat.toString()); SigarProxy proxy = SigarProxyCache.newInstance(getSigar()); traceln(CurrentProcessSummary.get(proxy).toString());