Changeset 3d30e14


Ignore:
Timestamp:
Feb 18, 2011 3:37:56 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
7269284
Parents:
aaf2fe9
Message:

fix LogSettingsTest? hang on fail

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/test/net/i2p/util/LogSettingsTest.java

    raaf2fe9 r3d30e14  
    9090            log.log(Log.CRIT, "DEBUG" + ": crit");
    9191
    92             // The following will take about 10 seconds as we wait for the
    93             // LogWriter to flush. There is no public flush() method
     92            // Wait for the LogWriter to flush, then write extra stuff so
     93            // the test doesn't hang on failure
     94            try { Thread.sleep(12*1000); } catch (InterruptedException ie) {}
     95            for (int i = 0; i < 5; i++)
     96                 pout.println("");
     97            pout.flush();
    9498            String l1 = in.readLine();
    9599            String l2 = in.readLine();
     
    135139            log.log(Log.CRIT, "INFO" + ": crit");
    136140
    137             // The following will take about 10 seconds as we wait for the
    138             // LogWriter to flush. There is no public flush() method
     141            // Wait for the LogWriter to flush, then write extra stuff so
     142            // the test doesn't hang on failure
     143            try { Thread.sleep(12*1000); } catch (InterruptedException ie) {}
     144            for (int i = 0; i < 4; i++)
     145                 pout.println("");
     146            pout.flush();
    139147            String l1 = in.readLine();
    140148            String l2 = in.readLine();
     
    178186            log.log(Log.CRIT, "WARN" + ": crit");
    179187
    180             // The following will take about 10 seconds as we wait for the
    181             // LogWriter to flush. There is no public flush() method
     188            // Wait for the LogWriter to flush, then write extra stuff so
     189            // the test doesn't hang on failure
     190            try { Thread.sleep(12*1000); } catch (InterruptedException ie) {}
     191            for (int i = 0; i < 3; i++)
     192                 pout.println("");
     193            pout.flush();
    182194            String l1 = in.readLine();
    183195            String l2 = in.readLine();
     
    218230            log.log(Log.CRIT, "ERROR" + ": crit");
    219231
    220             // The following will take about 10 seconds as we wait for the
    221             // LogWriter to flush. There is no public flush() method
     232            // Wait for the LogWriter to flush, then write extra stuff so
     233            // the test doesn't hang on failure
     234            try { Thread.sleep(12*1000); } catch (InterruptedException ie) {}
     235            for (int i = 0; i < 2; i++)
     236                 pout.println("");
     237            pout.flush();
    222238            String l1 = in.readLine();
    223239            String l2 = in.readLine();
     
    256272            log.log(Log.CRIT, "CRIT" + ": crit");
    257273
    258             // The following will take about 10 seconds as we wait for the
    259             // LogWriter to flush. There is no public flush() method
     274            // Wait for the LogWriter to flush, then write extra stuff so
     275            // the test doesn't hang on failure
     276            try { Thread.sleep(12*1000); } catch (InterruptedException ie) {}
     277            pout.println("");
     278            pout.flush();
    260279            String l1 = in.readLine();
    261280       
Note: See TracChangeset for help on using the changeset viewer.