diff --git a/test/k8s_test.go b/test/k8s_test.go
index 79e280be..3ddd6b62 100644
--- a/test/k8s_test.go
+++ b/test/k8s_test.go
@@ -4,16 +4,21 @@
 package test
 
 import (
+	"go.mondoo.com/cnquery/v9/providers"
 	"testing"
 
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
-	"go.mondoo.com/cnquery/v9/providers"
 	"go.mondoo.com/cnquery/v9/providers-sdk/v1/inventory"
 )
 
-func TestKubernetesBundles(t *testing.T) {
+func init() {
+	// There seems to be a small timing issue when provider installation is close to schema update.
+	// The provider is registered in the init() function to make sure it is loaded early
 	providers.EnsureProvider(providers.ProviderLookup{ID: "go.mondoo.com/cnquery/v9/providers/k8s"}, true, nil)
+}
+
+func TestKubernetesBundles(t *testing.T) {
 
 	type TestCase struct {
 		bundleFile string
diff --git a/test/terraform_test.go b/test/terraform_test.go
index c557f468..e873af2b 100644
--- a/test/terraform_test.go
+++ b/test/terraform_test.go
@@ -12,8 +12,11 @@ import (
 	"go.mondoo.com/cnquery/v9/providers-sdk/v1/inventory"
 )
 
-func TestTerraformBundles(t *testing.T) {
+func init() {
 	providers.EnsureProvider(providers.ProviderLookup{ID: "go.mondoo.com/cnquery/v9/providers/terraform"}, true, nil)
+}
+
+func TestTerraformBundles(t *testing.T) {
 	type TestCase struct {
 		bundleFile string
 		testDir    string