pulumi/sdk/go/common/testing
Abhinav Gupta 42c1a2bf01
testing/Environment: Tolerate faillures in deleting the test directory
CI land attempts have started failing occasionally on Windows
with the following error:

```
=== FAIL: . TestLanguageImportSmoke/go (4.00s)
    environment.go:96: Created new test environment:  C:\Users\RUNNER~1\AppData\Local\Temp\test-env711178549
    smoke_test.go:129: Running command pulumi login --cloud-url file://C:/Users/RUNNER~1/AppData/Local/Temp/test-env711178549
    smoke_test.go:130: Running command pulumi new go --yes
    smoke_test.go:131: Running command pulumi import --yes random:index/randomId:RandomId identifier p-9hUg
    history_test.go:28:
        	Error Trace:	C:/a/pulumi/pulumi/sdk/go/common/testing/environment.go:132
        	            				C:/a/pulumi/pulumi/tests/history_test.go:28
        	            				C:/a/pulumi/pulumi/tests/smoke_test.go:132
        	Error:      	Received unexpected error:
        	            	remove C:\Users\RUNNER~1\AppData\Local\Temp\test-env711178549\project: The process cannot access the file because it is being used by another process.
        	Test:       	TestLanguageImportSmoke/go
        	Messages:   	cleaning up test directory "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\test-env711178549"
```

The code path that is encountering this issue
is hit after the integration test has already passed.
So we're failing tests that are otherwise green
because it's taking a little too long for the system
to mark the resource as free.

This makes make DeleteEnvironment more tolerant of these failures,
logging them without marking the test as failed.
2023-05-11 17:02:51 -07:00
..
diagtest sdk/common: Add testing/diagtest package 2023-03-13 12:48:24 -07:00
iotest sdk/common: Add testing/diagtest package 2023-03-13 12:48:24 -07:00
environment.go testing/Environment: Tolerate faillures in deleting the test directory 2023-05-11 17:02:51 -07:00
environment_test.go all: Reformat with gofumpt 2023-03-03 09:00:24 -08:00