diff --git a/core/modules/simpletest/tests/ajax.test b/core/modules/simpletest/tests/ajax.test
index 8e731b8..72bf387 100644
--- a/core/modules/simpletest/tests/ajax.test
+++ b/core/modules/simpletest/tests/ajax.test
@@ -473,6 +473,12 @@ class AJAXMultiFormTestCase extends AJAXTestCase {
         $this->assertNoDuplicateIds(t('Updated page contains unique IDs'), 'Other');
       }
     }
+
+    // Tests that element ID's don't get duplicated when form validation fails.
+    $this->drupalGet('form-test/two-instances-of-same-form');
+    // Submit second node form with empty title.
+    $this->drupalPost(NULL, array(), t('Save'), array(), array(), 'page-node-form--2');
+    $this->assertNoDuplicateIds('There are no duplicate IDs');
   }
 }
 
