Skip to content

Commit

Permalink
better timeout assertion, changed connection attempt to marcelog.name
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelog committed Sep 1, 2012
1 parent 9f1f66f commit c60f121
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions test/resources/tcpclient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<value>1</value>
</property>
<property name="address">
<value>127.0.0.1</value>
<value>marcelog.name</value>
</property>
<property name="port">
<value>80</value>
Expand Down Expand Up @@ -74,7 +74,7 @@
<value>1</value>
</property>
<property name="address">
<value>127.0.0.1</value>
<value>marcelog.name</value>
</property>
<property name="port">
<value>80</value>
Expand All @@ -96,7 +96,7 @@
<value>1000000</value>
</property>
<property name="address">
<value>127.0.0.1</value>
<value>marcelog.name</value>
</property>
<property name="port">
<value>80</value>
Expand Down
8 changes: 5 additions & 3 deletions test/tcp/Test_TCP_Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public function can_timeout_on_connect()
while (MyClientHandler::$time < 1) {
usleep(1000);
}
$this->assertEquals(MyClientHandler::$time - $start, 10);
$length = MyClientHandler::$time - $start;
$this->assertTrue($length >= 10 && $length <= 15);
}

/**
Expand Down Expand Up @@ -147,7 +148,8 @@ public function can_timeout_on_starving_reading()
while (MyClientHandler::$time < 1) {
usleep(1000);
}
$this->assertEquals(MyClientHandler::$time - $start, 10);
$length = MyClientHandler::$time - $start;
$this->assertTrue($length >= 10 && $length <= 15);
}
/**
* @test
Expand Down Expand Up @@ -290,4 +292,4 @@ public function disconnect(\Ding\Helpers\Tcp\TcpPeer $peer)
{
self::$data = 'disconnect';
}
}
}

0 comments on commit c60f121

Please sign in to comment.