From 62bc59a3a6f8cab1393028dae47785cdf5ba3bd9 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 5 Dec 2024 19:20:46 +0100 Subject: [PATCH] Fail filer integration test if error is nil (#1967) ## Changes I found a race where this error is nil and the subsequent assert panics on the error being nil. This change makes the test robust against this to fail immediately if the error is different from the one we expect. ## Tests n/a --- internal/filer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/filer_test.go b/internal/filer_test.go index a2760d911..4e6a15671 100644 --- a/internal/filer_test.go +++ b/internal/filer_test.go @@ -457,7 +457,7 @@ func TestAccFilerWorkspaceNotebook(t *testing.T) { // Assert uploading a second time fails due to overwrite mode missing err = f.Write(ctx, tc.name, strings.NewReader(tc.content2)) - assert.ErrorIs(t, err, fs.ErrExist) + require.ErrorIs(t, err, fs.ErrExist) assert.Regexp(t, regexp.MustCompile(`file already exists: .*/`+tc.nameWithoutExt+`$`), err.Error()) // Try uploading the notebook again with overwrite flag. This time it should succeed.