Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 435356

Summary: Hidden Run/Debug Configuration causes confusion
Product: [Eclipse Project] JDT Reporter: Tim None <tim.myerscough+eclipse-bugzilla>
Component: DebugAssignee: Sarika Sinha <sarika.sinha>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r, Michael_Rennie, sarika.sinha, srikanth_sankaran
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug
Attachments:
Description Flags
screenshot of testcase
none
screenshot-2
none
screenshot-3
none
screenshot-4
none
screenshot-5 none

Description Tim None CLA 2014-05-21 03:01:18 EDT
There is a situation where modifying the Run -> Run Configurations arguments does not work, since the actual run configuration being executed is actually hidden from you.

Updating the visible one will not be reflected in your actual run.

Test Case:

    import static org.junit.Assert.assertEquals;
    
    import org.junit.Test;
    
    public class EclipseRunConfigurationTest {
    
        @Test
        public void test() {
            assertEquals("foo", System.getProperty("runProperty"));
        }
    
    }

 

 1. Run it - it will fail.
 2. Modify the run configuration, add "-DrunProperty=foo" VM parameter
 3. Run it again - it will pass
 4. Debug it, then switch to the debug view, 
    - RClick the <terminated> Junit launch -> Edit Rerun EclipseRunConfigurationTest...
    - Change the VM parameter to "-DrunProperty=bar"
    - Apply and Debug - it will fail
 5. Open the Run/Debug manager again 
    - Note that 'Rerun EclipseRunConfigurationTest' is not listed.  
    - Note that the VM parameter is still "-DrunProperty=foo"
    - No amount of changing it makes the slightest bit of difference.
Comment 1 Srikanth Sankaran CLA 2014-07-17 04:33:05 EDT
Pass to JDT/Debug for comment.
Comment 2 Sarika Sinha CLA 2014-07-17 05:21:15 EDT
I am not bale to reproduce this with
Version: Luna (4.4)
Build id: I20140606-1215

Modification of arguments are correctly reflected and I ma able to rerun the test. Can you verify the steps ?
Comment 3 Tim None CLA 2014-07-17 21:45:05 EDT
Able to reproduce with:
Version: Luna Release (4.4.0)
Build id: 20140612-0600


Test Case:

    import static org.junit.Assert.assertEquals;
    
    import org.junit.Test;
    
    public class EclipseRunConfigurationTest {
    
        @Test
        public void test() {
            assertEquals("foo", System.getProperty("runProperty"));
        }
    
    }

 

 1. Select file > Rclick > run as... > junit test - it will fail.
 2. Modify the run configuration: run (menu)> run configurations > EclipseRunConfigurationTest  
    * Add "-DrunProperty=foo" VM parameter
 3. Run it again using the Junit view: Junit View > EclipseRunConfigurationTest > (rClick) > run - it will pass
 4. Switch to debug perspective
   * Verify that the Debug view shows "<terminated>Rerun EclipseRunConfigurationTest"
   * Debug View > <terminated>Rerun EclipseRunConfigurationTest > (RClick) 
    - RClick the <terminated> Junit launch -> Edit Rerun EclipseRunConfigurationTest...
    - Change the VM parameter to "-DrunProperty=bar"
    - Apply and Debug - it will fail (debug-3)
 5. Open the Run/Debug manager again: Run(Menu) > Run Configurations... (debug-5)
    - Note that 'Rerun EclipseRunConfigurationTest' is not listed. 
    - Note that 'EclipseRunConfigurationTest' is listed.   
    - Note that the VM parameter is still "-DrunProperty=foo"
    - No amount of changing it makes the slightest bit of difference.
Comment 4 Tim None CLA 2014-07-17 21:50:30 EDT
However, contrary to Keplar, if you run the test from the toolbar again ( toolbar > run > EclipseRunConfigurationTest) then it works as expected, even when re-running from the JUnit view.

However, it is still confusing since if you change the run configuration when "Rerun XXX" is displayed, your configuration changes will effectively be lost.
Comment 5 Tim None CLA 2014-07-17 21:51:08 EDT
Created attachment 245170 [details]
screenshot of testcase
Comment 6 Tim None CLA 2014-07-17 21:51:30 EDT
Created attachment 245171 [details]
screenshot-2
Comment 7 Tim None CLA 2014-07-17 21:51:54 EDT
Created attachment 245172 [details]
screenshot-3
Comment 8 Tim None CLA 2014-07-17 21:52:18 EDT
Created attachment 245173 [details]
screenshot-4
Comment 9 Tim None CLA 2014-07-17 21:52:36 EDT
Created attachment 245174 [details]
screenshot-5
Comment 10 Sarika Sinha CLA 2014-07-21 05:33:09 EDT
RClick the <terminated> Junit launch -> Edit Rerun EclipseRunConfigurationTest...

I don't get Rerun EclipseRunConfigurationTest always , I get run Edit EclipseRunConfigurationTest and thats why it works for me .

Once I did get Rerun and I was bale to reproduce the issue. Will invistigate it.
Comment 11 Tim None CLA 2014-07-22 00:34:11 EDT
Thanks.

It's a bit of an obscure one, and it looks like the behaviour has changed slightly (in the right direction) since Kepler.  The Rerun Launch Configuration is being created on the fly (and is binned if you just run it again).

I'd expect that if the "Rerun" configuration is still required (not sure of the implementation details), then I'd expect it to also be persisted for the standard configuration.  If you can do away with the "Rerun" configuration entirely and just edit the "standard" run configuration, then that would be the simplest and most consistent approach for the user.
Comment 12 Michael Rennie CLA 2014-08-05 16:53:34 EDT
Some updated steps:

1. use the snippet from comment 0
2. Run As > JUnit Test
3. Edit the config from the debug view > add -DrunProperty=foo, re-run from the junit view
4. Rerun config shows up in the debug view

At first glance I'm not sure how we would work around this problem. Unless we set the temporary configuration as read-only, which would warn the user when they try to edit it.
Comment 13 Tim None CLA 2014-08-06 21:04:56 EDT
Rather than making the rerun configuration read only, is it possible to reflect the changes in the original?

I've not seen the code so not sure whether it's feasible.  Is there any reference (or can one be obtained) between the original and the rerun configurations?  Since there must be some relation at some point for the rerun configuration to exist, perhaps a reference could be maintained between the two?

Or alternatively, can the "re-run" configuration be removed completely, and simply the original configuration used/updated?
Comment 14 Eclipse Genie CLA 2020-03-13 17:17:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.