Index: tests/phpunit/includes/bootstrap.php
===================================================================
--- tests/phpunit/includes/bootstrap.php	(revision 38057)
+++ tests/phpunit/includes/bootstrap.php	(working copy)
@@ -86,6 +86,9 @@
 // Delete any default posts & related data
 _delete_all_posts();
 
+// Store query vars to reset after each test
+$GLOBALS['wp_bootstrapped'] = clone $GLOBALS['wp'];
+
 require dirname( __FILE__ ) . '/testcase.php';
 require dirname( __FILE__ ) . '/testcase-rest-api.php';
 require dirname( __FILE__ ) . '/testcase-xmlrpc.php';
Index: tests/phpunit/includes/functions.php
===================================================================
--- tests/phpunit/includes/functions.php	(revision 38057)
+++ tests/phpunit/includes/functions.php	(working copy)
@@ -154,3 +154,11 @@
 
 	return $uploads;
 }
+
+/**
+ * Restore the global `$wp`'s query vars back to the state after WP was loaded.
+ */
+function _restore_wp_query_vars() {
+	$GLOBALS['wp']->public_query_vars  = $GLOBALS['wp_bootstrapped']->public_query_vars;
+	$GLOBALS['wp']->private_query_vars = $GLOBALS['wp_bootstrapped']->private_query_vars;
+}
Index: tests/phpunit/includes/testcase.php
===================================================================
--- tests/phpunit/includes/testcase.php	(revision 38057)
+++ tests/phpunit/includes/testcase.php	(working copy)
@@ -146,6 +146,7 @@
 		}
 		$wp_query = new WP_Query();
 		$wp = new WP();
+		_restore_wp_query_vars();
 		$post = null;
 		remove_theme_support( 'html5' );
 		remove_filter( 'query', array( $this, '_create_temporary_tables' ) );
