Skip to content

Commit

Permalink
CE-3388 (#63)
Browse files Browse the repository at this point in the history
* Presence Timeout default value to 20

* remove hardcoded keys

* version bump

* codacy suggestions

* version bump date fix

* some fixes
  • Loading branch information
crimsonred authored and davidnub committed May 29, 2019
1 parent 88b6636 commit eb1e352
Show file tree
Hide file tree
Showing 19 changed files with 85 additions and 61 deletions.
9 changes: 8 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---
changelog:
-
changes:
-
text: "Presence Timeout cannot be lower than 20"
type: improvement
date: May 27, 19
version: v4.2.2
-
changes:
-
Expand Down Expand Up @@ -339,4 +346,4 @@ supported-platforms:
- "Mac OS X 10.8 or later, amd64"
- "Windows 7 or later, amd64, 386"
version: "PubNub Go SDK"
version: v4.2.1
version: v4.2.2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# PubNub 4.2.1 client for Go
# PubNub 4.2.2 client for Go
* Go (1.9+)

# Please direct all Support Questions and Concerns to [email protected]
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.1
4.2.2
16 changes: 15 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const (
presenceTimeout = 120
presenceTimeout = 0
)

// Config instance is storage for user-provided information which describe further
Expand Down Expand Up @@ -74,19 +74,33 @@ func NewConfig() *Config {
return &c
}

func (c *Config) checkMinTimeout(timeout int) int {
if timeout < minTimeout {
if c.Log != nil {
c.Log.Println(fmt.Sprintf("PresenceTimeout value less than the min recommended value of %[1]d, setting value to %[1]d %d", minTimeout, timeout))
}
timeout = minTimeout
}
return timeout
}

// SetPresenceTimeoutWithCustomInterval sets the presence timeout and interval.
// timeout: How long the server will consider the client alive for presence.
// interval: How often the client will announce itself to server.
func (c *Config) SetPresenceTimeoutWithCustomInterval(
timeout, interval int) *Config {
timeout = c.checkMinTimeout(timeout)
c.PresenceTimeout = timeout
c.HeartbeatInterval = interval

return c
}

var minTimeout = 20

// SetPresenceTimeout sets the presence timeout and automatically calulates the preferred timeout value.
// timeout: How long the server will consider the client alive for presence.
func (c *Config) SetPresenceTimeout(timeout int) *Config {
timeout = c.checkMinTimeout(timeout)
return c.SetPresenceTimeoutWithCustomInterval(timeout, (timeout/2)-1)
}
2 changes: 1 addition & 1 deletion pubnub.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
// Default constants
const (
// Version :the version of the SDK
Version = "4.2.1"
Version = "4.2.2"
// MaxSequence for publish messages
MaxSequence = 65535
)
Expand Down
2 changes: 1 addition & 1 deletion subscription_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import (

// Heartbeat:
// - Heartbeat is enabled by default.
// - Default presence timeout is 300 seconds.
// - Default presence timeout is 0 seconds.
// - The first Heartbeat request will be scheduled to be executed after
// getHeartbeatInterval() seconds (default - 149).
type SubscriptionManager struct {
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/add_channel_channel_group_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package e2e

import (
//"fmt"
"fmt"
//"log"
//"os"
"testing"
Expand Down Expand Up @@ -100,15 +100,15 @@ func TestAddChannelToChannelGroupSuccessAdded(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/channel-registration/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel-group/my-unique-group",
Path: fmt.Sprintf("/v1/channel-registration/sub-key/%s/channel-group/my-unique-group", config.SubscribeKey),
Query: "add=my-channel&q1=v1&q2=v2",
ResponseBody: "{\"status\": 200, \"message\": \"OK\", \"service\": \"channel-registry\", \"error\": \"false\"}",
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_cg"},
ResponseStatusCode: 200,
})
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/channel-registration/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel-group/my-unique-group",
Path: fmt.Sprintf("/v1/channel-registration/sub-key/%s/channel-group/my-unique-group", config.SubscribeKey),
Query: "q1=v1&q2=v2",
ResponseBody: "{\"status\": \"200\", \"payload\": {\"channels\": [\"my-channel\"], \"group\": \"my-unique-group\"}, \"service\": \"channel-registry\", \"error\": \"false\"}",
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_cg"},
Expand Down
7 changes: 4 additions & 3 deletions tests/e2e/delete_channel_group_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package e2e

import (
"fmt"
"testing"

pubnub "github.com/pubnub/go"
Expand Down Expand Up @@ -79,23 +80,23 @@ func TestRemoveChannelGroupSuccessRemoved(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/channel-registration/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel-group/my-unique-group-remove",
Path: fmt.Sprintf("/v1/channel-registration/sub-key/%s/channel-group/my-unique-group-remove", config.SubscribeKey),
Query: "add=my-channel-remove",
ResponseBody: `{"status": 200, "message": "OK", "service": "channel-registry", "error": false}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_cg"},
ResponseStatusCode: 200,
})
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/channel-registration/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel-group/my-unique-group-remove",
Path: fmt.Sprintf("/v1/channel-registration/sub-key/%s/channel-group/my-unique-group-remove", config.SubscribeKey),
Query: "remove=my-channel-remove&q1=v1&q2=v2",
ResponseBody: `{"status": 200, "message": "OK", "service": "channel-registry", "error": false}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_cg"},
ResponseStatusCode: 200,
})
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/channel-registration/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel-group/my-unique-group-remove",
Path: fmt.Sprintf("/v1/channel-registration/sub-key/%s/channel-group/my-unique-group-remove", config.SubscribeKey),
Query: "",
ResponseBody: `{"status": 200, "payload": {"channels": [], "group": "my-unique-group-remove"}, "service": "channel-registry", "error": false}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_cg"},
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/get_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ func TestGetStateSucess(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel/ch/uuid/" + config.UUID + "/data",
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/ch/uuid/", config.SubscribeKey) + config.UUID + "/data",
Query: "state=%7B%22age%22%3A%2220%22%2C%22name%22%3A%22John%20Doe%22%7D",
ResponseBody: `{"status": 200, "message": "OK", "payload": {"age": "20", "name": "John Doe"}, "service": "Presence"}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_pres"},
ResponseStatusCode: 200,
})
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel/ch/uuid/" + config.UUID,
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/ch/uuid/", config.SubscribeKey) + config.UUID,
Query: "",
ResponseBody: `{"status": 200, "message": "OK", "payload": {"age": "20", "name": "John Doe"}, "uuid": "bb45300a-25fb-4b14-8de1-388393274a54", "channel": "ch", "service": "Presence"}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "channel-group", "l_pres"},
Expand Down Expand Up @@ -115,15 +115,15 @@ func TestGetStateSucessQueryParam(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel/ch/uuid/" + config.UUID + "/data",
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/ch/uuid/", config.SubscribeKey) + config.UUID + "/data",
Query: "state=%7B%22age%22%3A%2220%22%2C%22name%22%3A%22John%20Doe%22%7D&q1=v1&q2=v2",
ResponseBody: `{"status": 200, "message": "OK", "payload": {"age": "20", "name": "John Doe"}, "service": "Presence"}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "l_pres"},
ResponseStatusCode: 200,
})
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64/channel/ch/uuid/" + config.UUID,
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/ch/uuid/", config.SubscribeKey) + config.UUID,
Query: "q1=v1&q2=v2",
ResponseBody: `{"status": 200, "message": "OK", "payload": {"age": "20", "name": "John Doe"}, "uuid": "bb45300a-25fb-4b14-8de1-388393274a54", "channel": "ch", "service": "Presence"}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "channel-group", "l_pres"},
Expand Down
18 changes: 9 additions & 9 deletions tests/e2e/grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func TestGrantMultipleMixed(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "auth=my-auth-key-1%2Cmy-auth-key-2&channel=ch1%2Cch2%2Cch3&channel-group=cg1%2Ccg2%2Ccg3&r=1&m=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel-group+auth","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channels":{"ch1":{"auths":{"my-auth-key-1":{"r":1,"w":1,"m":1,"d":0},"my-auth-key-2":{"r":1,"w":1,"m":1,"d":0}}},"ch2":{"auths":{"my-auth-key-1":{"r":1,"w":1,"m":1,"d":0},"my-auth-key-2":{"r":1,"w":1,"m":1,"d":0}}},"ch3":{"auths":{"my-auth-key-1":{"r":1,"w":1,"m":1,"d":0},"my-auth-key-2":{"r":1,"w":1,"m":1,"d":0}}}},"channel-groups":{"cg1":{"auths":{"my-auth-key-1":{"r":1,"w":1,"m":1,"d":0},"my-auth-key-2":{"r":1,"w":1,"m":1,"d":0}}},"cg2":{"auths":{"my-auth-key-1":{"r":1,"w":1,"m":1,"d":0},"my-auth-key-2":{"r":1,"w":1,"m":1,"d":0}}},"cg3":{"auths":{"my-auth-key-1":{"r":1,"w":1,"m":1,"d":0},"my-auth-key-2":{"r":1,"w":1,"m":1,"d":0}}}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "timestamp", "signature"},
Expand Down Expand Up @@ -236,7 +236,7 @@ func TestGrantSingleChannel(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "channel=ch1&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channels":{"ch1":{"r":1,"w":1,"m":0,"d":0}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -265,7 +265,7 @@ func TestGrantSingleChannelWithAuth(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "auth=my-pam-key&channel=ch1&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"user","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channel":"ch1","auths":{"my-pam-key":{"r":1,"w":1,"m":0,"d":0}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -294,7 +294,7 @@ func TestGrantMultipleChannels(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "channel=ch1%2Cch2&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channels":{"ch1":{"r":1,"w":1,"m":0,"d":0},"ch2":{"r":1,"w":1,"m":0,"d":0}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -327,7 +327,7 @@ func TestGrantMultipleChannelsWithAuth(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "auth=my-pam-key&channel=ch1%2Cch2&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"user","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channels":{"ch1":{"auths":{"my-pam-key":{"r":1,"w":1,"m":0,"d":0}}},"ch2":{"auths":{"my-pam-key":{"r":1,"w":1,"m":0,"d":0}}}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -361,7 +361,7 @@ func TestGrantSingleGroup(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "channel-group=cg1&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel-group","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channel-groups":{"cg1":{"r":1,"w":1,"m":0,"d":0}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -390,7 +390,7 @@ func TestGrantSingleGroupWithAuth(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "auth=my-pam-key&channel-group=cg1&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel-group+auth","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channel-groups":"cg1","auths":{"my-pam-key":{"r":1,"w":1,"m":0,"d":0}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -421,7 +421,7 @@ func TestGrantMultipleGroups(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "channel-group=cg1%2Ccg2&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel-group","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channel-groups":{"cg1":{"r":1,"w":1,"m":0,"d":0},"cg2":{"r":1,"w":1,"m":0,"d":0}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down Expand Up @@ -454,7 +454,7 @@ func TestGrantMultipleGroupsWithAuth(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v1/auth/grant/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4",
Path: fmt.Sprintf("/v1/auth/grant/sub-key/%s", pamConfig.SubscribeKey),
Query: "auth=my-pam-key&channel-group=cg1%2Ccg2&m=0&r=1&w=1&d=0",
ResponseBody: `{"message":"Success","payload":{"level":"channel-group+auth","subscribe_key":"sub-c-b9ab9508-43cf-11e8-9967-869954283fb4","ttl":1440,"channel-groups":{"cg1":{"auths":{"my-pam-key":{"r":1,"w":1,"m":0,"d":0}}},"cg2":{"auths":{"my-pam-key":{"r":1,"w":1,"m":0,"d":0}}}}},"service":"Access Manager","status":200}`,
IgnoreQueryKeys: []string{"uuid", "pnsdk", "signature", "timestamp"},
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/heartbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func TestHeartbeatStubbedRequest(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4/channel/" + ch + "/heartbeat",
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/", config.SubscribeKey) + ch + "/heartbeat",
Query: "heartbeat=6",
ResponseBody: "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\"}",
IgnoreQueryKeys: []string{"uuid", "pnsdk"},
Expand All @@ -161,7 +161,7 @@ func TestHeartbeatStubbedRequest(t *testing.T) {

interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4/channel/" + ch + "/leave",
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/", config.SubscribeKey) + ch + "/leave",
Query: "",
ResponseBody: "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"action\": \"leave\"}",
IgnoreQueryKeys: []string{"uuid", "pnsdk"},
Expand Down Expand Up @@ -217,7 +217,7 @@ func TestHeartbeatStubbedRequest(t *testing.T) {

select {
case <-doneHeartbeat:
case <-time.After(3 * time.Second):
case <-time.After(10 * time.Second):
assert.Fail("Heartbeat status was expected")
}

Expand All @@ -234,7 +234,7 @@ func TestHeartbeatRequestWithError(t *testing.T) {
interceptor := stubs.NewInterceptor()
interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4/channel/" + ch + "/heartbeat",
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/"+ch+"/heartbeat", config.SubscribeKey),
Query: "heartbeat=6",
ResponseBody: "{\"status\": 404, \"message\": \"Not Found\", \"error\": \"1\", \"service\": \"Presence\"}",
IgnoreQueryKeys: []string{"uuid", "pnsdk"},
Expand All @@ -243,7 +243,7 @@ func TestHeartbeatRequestWithError(t *testing.T) {

interceptor.AddStub(&stubs.Stub{
Method: "GET",
Path: "/v2/presence/sub-key/sub-c-b9ab9508-43cf-11e8-9967-869954283fb4/channel/" + ch + "/leave",
Path: fmt.Sprintf("/v2/presence/sub-key/%s/channel/"+ch+"/leave", config.SubscribeKey),
Query: "",
ResponseBody: "{\"status\": 200, \"message\": \"OK\", \"service\": \"Presence\", \"action\": \"leave\"}",
IgnoreQueryKeys: []string{"uuid", "pnsdk"},
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestHeartbeatRequestWithError(t *testing.T) {

select {
case <-doneHeartbeat:
case <-time.After(3 * time.Second):
case <-time.After(10 * time.Second):
assert.Fail("Heartbeat status was expected")
}

Expand Down
11 changes: 6 additions & 5 deletions tests/e2e/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ func init() {
rand.Seed(time.Now().UnixNano())

config = pubnub.NewConfig()
config.PublishKey = "pub-c-afeb2ec5-45e9-449f-9a8d-c4940a9c7836"
config.SubscribeKey = "sub-c-e41d50d4-43ce-11e8-a433-9e6b275e7b64"
config.PublishKey = "pub-c-c1648ded-d156-4a2d-9dbb-a23262945fe2"
config.SubscribeKey = "sub-c-c14b8948-7dfe-11e9-aee4-2e27e4d79cf8"

pamConfig = pubnub.NewConfig()
pamConfig.PublishKey = "pub-c-7e5c6521-91d0-4e60-9656-4bed419a769b"
pamConfig.SubscribeKey = "sub-c-b9ab9508-43cf-11e8-9967-869954283fb4"
pamConfig.SecretKey = "sec-c-MjRhODgwMTgtY2RmMS00ZWNmLTgzNTUtYjI3MzZhOThlNTY0"
pamConfig.PublishKey = "pub-c-2dea72e4-e0aa-4c85-9411-d75baf7568b7"
pamConfig.SubscribeKey = "sub-c-490a8ac8-7e0e-11e9-84e9-eed29b7b36d8"
pamConfig.SecretKey = "sec-c-MDU3OGY1ZjMtMDUwZS00NTc4LWFhM2ItN2E3NzhmMDVkZmQx"

}

func configCopy() *pubnub.Config {
Expand Down
Loading

0 comments on commit eb1e352

Please sign in to comment.