Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-112050 - Pxr tests will use build area for temporary files. #1443

Merged
merged 1 commit into from
Jun 15, 2021

Conversation

JGamache-autodesk
Copy link
Collaborator

Result:

E:\Ws\UsdBuild\MayaUSD\build>ctest -V -R Package
...
163: Environment variables:
163:  TMP=E:/Ws/UsdBuild/MayaUSD/build/test/Temporary/testUsdExportPackage
163:  TEMP=E:/Ws/UsdBuild/MayaUSD/build/test/Temporary/testUsdExportPackage
...
163: Opening layer 'e:/Ws/UsdBuild/MayaUSD/build/test/Temporary/testUsdExportPackage/tmpdugxsng1/tmp-305918D1-45DE-C901-944D-D99D49A7FEB1.usdc' for writing

@JGamache-autodesk JGamache-autodesk added the unit test Related to unit tests (both python or c++) label May 28, 2021
@@ -385,6 +385,15 @@ function(pxr_register_test TEST_NAME)
"--pre-path=${_testPrePath}" ${testCmd}
)

# Set a temporary folder path for the test
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kxl-adsk kxl-adsk requested a review from dj-mcg May 28, 2021 15:57
Copy link
Contributor

@HamedSabri-adsk HamedSabri-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jerry. Looks good.

For the sake of documentation, can you describe the scenario where you hit this?

@JGamache-autodesk
Copy link
Collaborator Author

Well, I was trying to fix the exact failure I have in the unit test that failed in this commit:

09:04:34     testArKitCompatibility (__main__.testUsdExportPackage)
09:04:34     Tests usdz package export with ARKit compatibility profile. ... Warning: This file is from an older version of Maya.  If saved, it will not be readable by previous versions.
09:04:34     File read in  0.5 seconds.
09:04:34     Viewport 2.0 floating point render target is turned off.
09:04:34     Viewport 2.0 floating point render target is turned on for color management.
09:04:34     Opening layer 'w:/build/relwithdebinfo/test/temporary/testusdexportpackage/tmpp1hsky/tmp-542FDF81-4C23-A396-84CC-E1A02D084766.usdc' for writing
09:04:34     Saving stage
09:04:34     Packaging USDZ file
09:04:34     Warning: The given asset 'w:/build/relwithdebinfo/test/temporary/testusdexportpackage/tmpp1hsky/tmp-542FDF81-4C23-A396-84CC-E1A02D084766.usdc' contains one or more composition arcs referencing external USD files. Flattening it to a single .usdc file before packaging. This will result in loss of features such as variantSets and all asset references to be absolutized.
09:04:34     Error: Failed to delete 'w:/build/relwithdebinfo/test/temporary/testusdexportpackage/tmpp1hsky/tmp-542FDF81-4C23-A396-84CC-E1A02D084766.usdc'
09:04:34     FAIL
09:04:34     testExport (__main__.testUsdExportPackage)
09:04:34     Tests standard usdz package export. ... Warning: This file is from an older version of Maya.  If saved, it will not be readable by previous versions.
09:04:34     File read in  0.078 seconds.
09:04:34     Viewport 2.0 floating point render target is turned off.
09:04:34     Viewport 2.0 floating point render target is turned on for color management.
09:04:34     Opening layer 'w:/build/relwithdebinfo/test/temporary/testusdexportpackage/tmpp1hsky/tmp-C90445CB-4D77-B559-8746-A499492BBEA0.usdc' for writing
09:04:34     Saving stage
09:04:34     Packaging USDZ file
09:04:34     FAIL

Which squarely means that this fix is not the solution. I will most probably close that PR without asking for a merge.

I suspect the USD check that a file has been really deleted in TfDeleteFile, which calls _unlink on Windows can not work if any handle is still opened on the file. On Unix OS, unlink always work because the inode held by program handles is not the same as the directory inode that unlink will always remove successfully.

Another potential fix could be done, still in USD, to make sure the temporary stage created to export the file goes out of scope before the call to TfDeleteFile.

@kxl-adsk kxl-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 15, 2021
@kxl-adsk kxl-adsk merged commit 191dc21 into dev Jun 15, 2021
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-112050/pxr_temp_in_build_area branch June 15, 2021 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge unit test Related to unit tests (both python or c++)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants