File tree Expand file tree Collapse file tree 2 files changed +70
-9
lines changed
tests/integration/memcached Expand file tree Collapse file tree 2 files changed +70
-9
lines changed Original file line number Diff line number Diff line change 6
6
7
7
/*DESCRIPTION
8
8
The agent should report instance metrics when multiple servers are
9
- added at once
9
+ added at once via Memcached::addServers()
10
10
*/
11
11
12
12
/*SKIPIF
17
17
*/
18
18
19
19
/*EXPECT_METRICS_EXIST
20
- Datastore/instance/Memcached/host1/1
21
- Datastore/instance/Memcached/host2/2
22
- Datastore/instance/Memcached/host3/11211
23
- Datastore/instance/Memcached/host4/1
20
+ Datastore/instance/Memcached/host1/1, 1
21
+ Datastore/instance/Memcached/host2/2, 1
22
+ Datastore/instance/Memcached/host3/11211, 1
23
+ Datastore/instance/Memcached/host4/1, 1
24
24
*/
25
25
26
+ /*EXPECT_ERROR_EVENTS null */
27
+
26
28
require_once (realpath (dirname ( __FILE__ )) . '/../../include/helpers.php ' );
27
29
require_once (realpath (dirname ( __FILE__ )) . '/../../include/tap.php ' );
28
30
require_once (realpath (dirname ( __FILE__ )) . '/memcache.inc ' );
34
36
array ("host3 " , 11211 )));
35
37
$ memcached ->addServers (array ());
36
38
$ memcached ->addServers (array (array ("host4 " , 1 , "test field " )));
37
- $ memcached ->addServers (array (array (1 )));
38
- $ memcached ->addServers (array (array ("host1 " )));
39
- $ memcached ->addServers (array (array (1 , "host1 " )));
40
- //$memcahed->addServers("string"); crashes PHP
41
39
$ memcached ->quit ();
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /*
3
+ * Copyright 2020 New Relic Corporation. All rights reserved.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /*DESCRIPTION
8
+ The agent should gracefully handle when malformed server entries
9
+ are added via Memcached::addServers()
10
+ */
11
+
12
+ /*SKIPIF
13
+ <?php require('skipif.inc'); ?>
14
+ */
15
+
16
+ /*INI
17
+ */
18
+
19
+ /*EXPECT_REGEX
20
+ ^\s*(PHP )?Warning:\s*could not add entry\s*$
21
+ ^\s*(PHP )?Warning:\s*could not add entry\s*$
22
+ */
23
+
24
+ /*EXPECT_ERROR_EVENTS
25
+ [
26
+ "?? agent run id",
27
+ {
28
+ "reservoir_size": "??",
29
+ "events_seen": 1
30
+ },
31
+ [
32
+ [
33
+ {
34
+ "type": "TransactionError",
35
+ "timestamp": "??",
36
+ "error.class": "E_WARNING",
37
+ "error.message": "Memcached::addServers(): could not add entry #2 to the server list",
38
+ "transactionName": "OtherTransaction\/php__FILE__",
39
+ "duration": "??",
40
+ "nr.transactionGuid": "??",
41
+ "guid": "??",
42
+ "sampled": true,
43
+ "priority": "??",
44
+ "traceId": "??",
45
+ "spanId": "??"
46
+ },
47
+ {},
48
+ {}
49
+ ]
50
+ ]
51
+ ]
52
+ */
53
+
54
+ require_once (realpath (dirname ( __FILE__ )) . '/../../include/helpers.php ' );
55
+ require_once (realpath (dirname ( __FILE__ )) . '/../../include/tap.php ' );
56
+ require_once (realpath (dirname ( __FILE__ )) . '/memcache.inc ' );
57
+
58
+ $ memcached = new Memcached ();
59
+ $ memcached ->addServers (array (array (1 )));
60
+ $ memcached ->addServers (array (array ("host1 " )));
61
+ $ memcached ->addServers (array (array (1 , "host1 " )));
62
+ //$memcahed->addServers("string"); crashes PHP
63
+ $ memcached ->quit ();
You can’t perform that action at this time.
0 commit comments