You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: actor_activation_test.go
    path of file: ./repos/dapr/tests/e2e/actor_activation
    
    the code of the file until where you have to start completion: //go:build e2e
// +build e2e

/*
Copyright 2021 The Dapr Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package activation

import (
	"encoding/json"
	"fmt"
	"os"
	"testing"
	"time"

	"github.com/dapr/dapr/tests/e2e/utils"
	kube "github.com/dapr/dapr/tests/platforms/kubernetes"
	"github.com/dapr/dapr/tests/runner"
	guuid "github.com/google/uuid"
	"github.com/stretchr/testify/require"
)

const (
	appName                          = "actorapp"                                // App name in Dapr.
	numHealthChecks                  = 60                                        // Number of get calls before starting tests.
	secondsToCheckActorRemainsActive = 1                                         // How much time to wait to make sure actor is deactivated
	secondsToCheckActorDeactivation  = 20                                        // How much time to wait to make sure actor is deactivated
	actorInvokeURLFormat             = "%s/test/testactor/%s/method/actormethod" // URL to invoke a Dapr's actor method in test app.
	actorlogsURLFormat               = "%s/test/logs"                            // URL to fetch logs from test app.
)

// represents a response for the APIs in this app.
type actorLogEntry struct {
	Action    string `json:"action,omitempty"`
	ActorType string `json:"actorType,omitempty"`
	Act
    
func TestActorActivation(t *testing.T) {
	externalURL := tr.Platform.AcquireAppExternalURL(appName)
	require.NotEmpty(t, externalURL, "external URL must not be empty!")

	logsURL := fmt.Sprintf(actorlogsURLFormat, externalURL)

	// This initial probe makes the test wait a little bit longer when needed,
	// making this test less flaky due to delays in the deployment.
	_, err := utils.HTTPGetNTimes(externalURL, numHealthChecks)
	require.NoError(t, err)

	// Wait until runtime finds the leader of placements.
	time.Sleep(15 * time.Second)

	t.Run("Actor deactivates due to timeout.", func(t *testing.T) {
		actorID := "100"

		invokeURL := fmt.Sprintf(actorInvokeURLFormat, externalURL, actorID)

		_, err = utils.HTTPPost(invokeURL, []byte{})
		require.NoError(t, err)

		fmt.Printf("getting logs, the current time is %s\n", time.Now())
		resp, err := utils.HTTPGet(logsURL)
		require.NoError(t, err)

		// there is no longer an activated message
		require.False(t, findActorActivation(resp, actorID))

		require.True(t, findActorMethodInvokation(resp, actorID))
		require.False(t, findActorDeactivation(resp, actorID))

		time.Sleep(secondsToCheckActorDeactivation * time.Second)

		fmt.Printf("getting logs, the current time is %s\n", time.Now())
		resp, err = utils.HTTPGet(logsURL)
		require.NoError(t, err)

		// there is no longer an activated message
		require.False(t, findActorActivation(resp, actorID))

		require.True(t, findActorMethodInvokation(resp, actorID))
		require.True(t, findActorDeactivation(resp, actorID))
	})

	t.Run("Actor does not deactivate since there is no timeout.", func(t *testing.T) {
		actorID := guuid.New().String()
		invokeURL := fmt.Sprintf(actorInvokeURLFormat, externalURL, actorID)

		_, err = utils.HTTPPost(invokeURL, []byte{})
		require.NoError(t, err)

		resp, err := utils.HTTPGet(logsURL)
		require.NoError(t, err)

		// there is no longer an activate message
		require.False(t, findActorActivation(resp, actorID))

		require.True(t, findActorMethodInvokation(resp, actorID))
		require.False(t, findActorDeactivation(resp, actorID))

		time.Sleep(secondsToCheckActorRemainsActive * time.Second)

		resp, err = utils.HTTPGet(logsURL)
		require.NoError(t, err)

		// there is no longer an activate message
		require.False(t, findActorActivation(resp, actorID))

		require.True(t, findActorMethodInvokation(resp, actorID))
		require.False(t, findActorDeactivation(resp, actorID))
	})
}