Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309302

java/net/Socket/Timeouts.java fails with AssertionError on test temporal post condition

    XMLWordPrintable

Details

    • b05
    • x86_64
    • windows

    Backports

      Description

        The failing test has a temporal post condition which may not hold true on a heavily loaded system.

            public void testTimedAccept7() throws IOException {
                try (ServerSocket ss = boundServerSocket()) {
                    ss.setSoTimeout(30*1000);
                    long delay = 2000;
                    scheduleClose(ss, delay);
                    long startMillis = millisTime();
                    try {
                        ss.accept().close();
                        fail();
                    } catch (SocketException expected) {
                        checkDuration(startMillis, delay-100, delay+2000);
                    }
                }
            }

        It possible that the scheduled close my not be delivery in timely manner, such that the temporal constraint on the epoch for delivery is somewhat contrived.

        The main semantics that is extracted from the test is that the close is delivered prior the timeout set on the serversocket.

        Attachments

          Issue Links

            Activity

              People

                dclarke Darragh Clarke
                msheppar Mark Sheppard
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: