From d6dd0a74b64a2c20c73ccb627e98751727af1958 Mon Sep 17 00:00:00 2001 From: Reuben Miller Date: Fri, 5 Apr 2024 13:40:30 +0200 Subject: [PATCH] test: use unique measurement type to prevent side effects across test instances --- test/c8y_test/measurement_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/c8y_test/measurement_test.go b/test/c8y_test/measurement_test.go index 035c52b8..6aa37d06 100644 --- a/test/c8y_test/measurement_test.go +++ b/test/c8y_test/measurement_test.go @@ -381,7 +381,7 @@ func TestMeasurementService_DeleteMeasurements(t *testing.T) { testDevice, err := createRandomTestDevice() testingutils.Ok(t, err) - valueFragmentType := "nx_Type1" + valueFragmentType := "nx_Type1_" + testingutils.RandomString(5) createMeasVariable1 := measurementFactory(client, testDevice.ID, valueFragmentType, "Variable1") createMeasVariable2 := measurementFactory(client, testDevice.ID, valueFragmentType, "Variable2") @@ -422,6 +422,7 @@ func TestMeasurementService_DeleteMeasurements(t *testing.T) { // Check that the measurements have been removed // Check by requesting the new collection again as retrieving single measurements // is no longer supported by Cumulocity IoT + time.Sleep(2 * time.Second) // give server some time to delete the measurements measColAfter, resp, err := client.Measurement.GetMeasurements( context.Background(), searchOptions,