nodejs-bigtable icon indicating copy to clipboard operation
nodejs-bigtable copied to clipboard

System-test is not cleaning up instances properly

Open mutianf opened this issue 3 years ago • 5 comments

system-test failed to clean up test instances with not found errors like: Error: 5 NOT_FOUND: Failed to read: projects/{818418350420}/instances/gcloud-tests-d-inst-c089e871 which causes the test project to run out of node quota.

mutianf avatar Feb 02 '22 23:02 mutianf

Is it throwing the error on a test and then as a result, not running one of the after hooks?

danieljbruce avatar Aug 12 '22 20:08 danieljbruce

Also happens here: https://github.com/googleapis/nodejs-bigtable/issues/1099

danieljbruce avatar Aug 12 '22 20:08 danieljbruce

Happens in https://github.com/googleapis/nodejs-bigtable/issues/1113

danieljbruce avatar Aug 12 '22 20:08 danieljbruce

Happens in https://github.com/googleapis/nodejs-bigtable/issues/975

danieljbruce avatar Aug 12 '22 21:08 danieljbruce

Looking into this further, it looks like https://github.com/googleapis/nodejs-bigtable/blob/main/system-test/bigtable.ts#L110 should be cleaning up instances, but is not? Maybe we could always delete all existing instances before running tests? Maybe errors prevent the after hook from running?

danieljbruce avatar Sep 27 '22 19:09 danieljbruce

I think now we rename the tests so that they include a date and we can find another mechanism for cleaning up leftover instances.

danieljbruce avatar Feb 09 '23 21:02 danieljbruce

Due to a code change the instances were not being cleaned up because they were filtering on a prefix that didn't match the prefix of the instances being created. this PR ensures the prefix used for instance creation is the same as the prefix used when filtering for instance cleanup so that instances actually get cleaned up.

danieljbruce avatar Oct 06 '23 19:10 danieljbruce