Index: tests/phpunit/tests/filters.php
===================================================================
--- tests/phpunit/tests/filters.php	(revision 40959)
+++ tests/phpunit/tests/filters.php	(working copy)
@@ -380,4 +380,24 @@
 		global $wp_filter;
 		$this->current_priority = $wp_filter[ 'the_content' ]->current_priority();
 	}
+
+	/**
+	 * @ticket 41185
+	 */
+	public function test_current_priority_after_nested_add_action(){
+		add_action( 'test_current_priority', array( $this, '_nested_action' ), 99 );
+		do_action( 'test_current_priority' );
+		remove_action( 'test_current_priority', array( $this, '_other_priority_action' ), 99 );
+		remove_action( 'test_current_priority', array( $this, '_nested_action' ), 100 );
+
+		$this->assertSame( 99, $this->current_priority );
+	}
+
+	public function _nested_action() {
+		add_action( 'test_current_priority', function(){}, 100 );
+
+		global $wp_filter;
+		$this->current_priority = $wp_filter[ current_filter() ]->current_priority();
+	}
+
 }
