Index: tests/http/base.php
===================================================================
--- tests/http/base.php	(revision 935)
+++ tests/http/base.php	(working copy)
@@ -178,4 +178,83 @@
 
 		unlink($res['filename']); // Remove the temporary file
 	}
+
+	/**
+	 * Test that the timeouts are functioning as inteded
+	 * @ticket 13841
+	 * @return void
+ 	 */
+	function test_timeout() {
+		// Create a fake server to make requests from
+		$server = new SimpleSocketServer();
+		try {
+			$server->start( '127.0.0.1', 8112 );
+		} catch ( Exception $e ) {
+			$this->markTestIncomplete( "Could not start socket server: " . $e->getMessage() );
+		}
+
+		// Make the request and time out
+		$url = 'http://127.0.0.1:8112/';
+		$start = microtime( true );
+		$res = wp_remote_request( $url, array( 'timeout' => 1 ) );
+		$stop = microtime( true );
+		$server->stop();
+
+		// Make sure it's a timeout
+		$this->assertTrue( is_wp_error( $res ) );
+		$this->assertEquals( 'http_request_failed', $res->get_error_code() );
+
+		// Make sure the runtime was between .9 and 1.1 seconds
+		$this->assertGreaterThanOrEqual( .9, ($stop - $start) );
+		$this->assertLessThanOrEqual( 1.1, ($stop - $start) );
+ 	}
 }
+
+/**
+ * Simple socket server
+ *
+ * Create a server which never responds.  This is
+ * fairly useless, unless you're testing timeouts.
+ *
+ * @package    WordPress
+ * @subpackage Unit Tests
+ * @since      3.4.1
+ */
+class SimpleSocketServer {
+
+	/**
+	 * Socket
+	 * @var mixed
+	 */
+	protected $_sock = null;
+
+	/**
+	 * Start listening
+	 * @param string $ip
+	 * @param int $port
+	 * @throws Exception
+	 * @return void
+	 */
+	public function start( $ip, $port ) {
+		$this->_sock = stream_socket_server( "tcp://$ip:$port", $errno, $errstr );
+		stream_set_blocking( $this->_sock, 0 );
+	}
+
+	/**
+	 * Stop listening
+	 * @return void
+	 */
+	public function stop() {
+		if ( null !== $this->_sock ) {
+			fclose( $this->_sock );
+		}
+	}
+
+	/**
+	 * Destructor
+	 * @return void
+	 */
+	public function __destruct() {
+		$this->stop;
+	}
+}

