I doubt that it created the part in both files.
How do you “see” the new part? Through your application?
I can think of two ways this could happen,
1. the application uses a logical file, in building the test you must compile the required physical files first, then the logical files. If a logical is compiled first the system will search the library list until it finds a physical and create the logical pointing at it. You can tell where your logicals are pointing by using the DSPFD command with the logical file name. You could also tell what logicals are attched to a physical with the DSPPFREF command.
2. Your application is targeted at files in production. It could be using OVRDBF commands in the CL or RPG programs, RPG F specs with extfile command, or logical or views, or SQL’s that specifically define the library to use.
While your application is on the view/create part screen use another session to run WRKUSRJOB – F14 will show the files in use including the libraries. There is also an option to see the Overrides.
Hope this helps