From b3eb66e17c7112a052413bd5e4b89d4db59faf31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 13:18:54 +0300 Subject: [PATCH 01/15] Document Properties --- DOCUMENTATION.md | 104 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 76 insertions(+), 28 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 4d0b10f4f..64549ac1f 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -17,10 +17,11 @@ * [1.6. Code Samples](#16-code-samples) * [2. Features](#2-features) * [3. Configuration](#3-configuration) + * [3.1 Client Properties](#31-client-properties) * [4. Serialization](#4-serialization) * [4.1. IdentifiedDataSerializable Serialization](#41-identifieddataserializable-serialization) * [4.2. Portable Serialization](#42-portable-serialization) - * [4.2.1. Versioning for Portable Serialization](#421-versioning-for-portable-serialization) + * [4.2.1. Versioning for Portable Serialization](#421-versioning-for-portable-serialization) * [4.3. Custom Serialization](#43-custom-serialization) * [4.4. Global Serialization](#44-global-serialization) * [4.5. JSON Serialization](#45-json-serialization) @@ -564,6 +565,71 @@ const client = await Client.newHazelcastClient(cfg); In the following chapters you will learn the description of all options supported by Hazelcast Node.js client. +# 3.1 Client Properties + +- `hazelcast.client.autopipelining.enabled`: +Default value is `true`. Turns automated pipelining feature on/off. +If your application does only writes operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. + +- `hazelcast.client.autopipelining.threshold.bytes`: +Default value is `65536` bytes (64 KB). This is the coalescing threshold for the internal queue used by automated pipelining. +Once the total size of operation payloads taken from the queue reaches this value during batch preparation, +these operations are written to the socket. Notice that automated pipelining will still send operations if their total size +is smaller than the threshold and there are no more operations in the internal queue. + +- `hazelcast.client.cloud.url`: Hazelcast Cloud URL. Default value is `https://coordinator.hazelcast.cloud`. + +- `hazelcast.client.heartbeat.interval`: +Frequency of the heartbeat messages sent by the clients to members. Default value is `5000` milliseconds. + +- `hazelcast.client.heartbeat.timeout`: +Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member +within the given time via this property in milliseconds, the connection will be closed. Default value is `60000` milliseconds. + +- `hazelcast.client.invocation.retry.pause.millis`: +Pause time between each retry cycle of an invocation in milliseconds. Default value is `1000` milliseconds. + +- `hazelcast.client.invocation.timeout.millis`: +Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. Default value is `120000` milliseconds. + +- `hazelcast.client.operation.backup.timeout.millis`: Default value is `5000` milliseconds. If an operation has +backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. +If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. + +- `hazelcast.client.operation.fail.on.indeterminate.state`: +Default value is `false`. When it is `true`, if an operation has sync backups and acks are not received +from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, +then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. + +- `hazelcast.client.shuffle.member.list`: +The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. +When it is set to false, the client tries to connect to the members in the given order. Default value is `true`. + +- `hazelcast.client.socket.no.delay`: +The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. Default value is `true`. + +- `hazelcast.client.statistics.enabled`: +If set to `true`, it enables collecting the client statistics and sending them to the cluster. +When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. +Its default value is `false`. + +- `hazelcast.client.statistics.period.seconds`: +Period in seconds the client statistics are collected and sent to the cluster. Its default value is `3`. + +- `hazelcast.discovery.public.ip.enabled`: +Default value is `null` (detection enabled). When set to `true`, the client will assume that it needs to use public IP addresses reported by members. +When set to `false`, the client will always use private addresses reported by members. + +- `hazelcast.invalidation.max.tolerated.miss.count`: +Default value is `10`. If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. + +- `hazelcast.invalidation.min.reconciliation.interval.seconds`: +Minimum allowed value for `hazelcast.invalidation.reconciliation.interval.seconds`. + +- `hazelcast.invalidation.reconciliation.interval.seconds`: Default value is `60` seconds. +This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. + +- `hazelcast.logging.level`: Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. # 4. Serialization @@ -1041,12 +1107,7 @@ const cfg = { Its default value is `true`. This option has no effect for unisocket clients. -You can also fine-tune this feature using entries of the `properties` config option as described below: - -- `hazelcast.client.operation.backup.timeout.millis`: Default value is `5000` milliseconds. If an operation has -backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. - -- `hazelcast.client.operation.fail.on.indeterminate.state`: Default value is `false`. When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. +You can also fine-tune this feature using `hazelcast.client.operation.backup.timeout.millis` and `hazelcast.client.operation.fail.on.indeterminate.state` [properties](#31-client-properties): ## 5.8. External Client Public Address Discovery @@ -1061,9 +1122,7 @@ Hazelcast Node.js client has a built-in mechanism to detect such situation. When For more details on member-side configuration, refer to the [Discovery SPI section](https://docs.hazelcast.com/imdg/latest/extending-hazelcast/discovery-spi.html) in the Hazelcast IMDG Reference Manual. -You can disable the detection mechanism and specify the client behavior by using the following `properties` config option: - -- `hazelcast.discovery.public.ip.enabled`: Default value is `null` (detection enabled). When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. +You can disable the detection mechanism and specify the client behavior by using the `hazelcast.discovery.public.ip.enabled` [property](#31-client-properties). > **NOTE: The detection mechanism is disabled when the client is configured to use [TLS/SSL encryption](#91-tlsssl). In such setup you should explicitly set the `hazelcast.discovery.public.ip.enabled` property.** @@ -1260,7 +1319,7 @@ The client executes each operation through the already established connection to While sending requests to cluster members, the operations may fail due to various reasons. Read-only operations are retried by default. If you want to enable retrying for non-read-only operations, you can set the `redoOperation` to `true`. See the [Enabling Redo Operation section](#53-enabling-redo-operation). -You can set a timeout for retrying the operations sent to a member. This can be provided by using the property `hazelcast.client.invocation.timeout.millis` in the `properties` option. The client will retry an operation within this given period, of course, if it is a read-only operation or you enabled the `redoOperation` as stated in the above paragraph. This timeout value is important when there is a failure resulted by either of the following causes: +You can set a timeout for retrying the operations sent to a member. This can be provided by using the property `hazelcast.client.invocation.timeout.millis` in the client [properties](#31-client-properties). The client will retry an operation within this given period, of course, if it is a read-only operation or you enabled the `redoOperation` as stated in the above paragraph. This timeout value is important when there is a failure resulted by either of the following causes: * Member throws an exception. * Connection between the client and member is closed. @@ -2971,21 +3030,13 @@ Near Caches are invalidated by invalidation events. Invalidation events can be l To solve this problem, Hazelcast provides eventually consistent behavior for Map Near Caches by detecting invalidation losses. After detection of an invalidation loss, stale data will be made unreachable and Near Cache’s `get` calls to that data will be directed to underlying Map to fetch the fresh data. -You can configure eventual consistency with entries of the `properties` config option as described below: - -- `hazelcast.invalidation.max.tolerated.miss.count`: Default value is `10`. If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. - -- `hazelcast.invalidation.reconciliation.interval.seconds`: Default value is `60` seconds. This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. +You can configure eventual consistency with `hazelcast.invalidation.max.tolerated.miss.count` and `hazelcast.invalidation.reconciliation.interval.seconds` [properties](#31-client-properties). ### 8.9.3. Automated Pipelining Hazelcast Node.js client performs automated pipelining of operations. It means that the library pushes all operations into an internal queue and tries to send them in batches. This reduces the count of executed `Socket.write()` calls and significantly improves throughtput for read operations. -You can configure automated operation pipelining with entries of the `properties` config option as described below: - -- `hazelcast.client.autopipelining.enabled`: Default value is `true`. Turns automated pipelining feature on/off. If your application does only writes operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughtput. - -- `hazelcast.client.autopipelining.threshold.bytes`: Default value is `65536` bytes (64 KB). This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. +You can configure automated operation pipelining with `hazelcast.client.autopipelining.enabled` and `hazelcast.client.autopipelining.threshold.bytes` [properties](#31-client-properties). ## 8.10. Monitoring and Logging @@ -2993,11 +3044,8 @@ You can configure automated operation pipelining with entries of the `properties You can monitor your clients using Hazelcast Management Center. -As a prerequisite, you need to enable the client statistics in the Node.js client. There are two entries supported by the `properties` config option which are related to client statistics: - -- `hazelcast.client.statistics.enabled`: If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. Its default value is `false`. - -- `hazelcast.client.statistics.period.seconds`: Period in seconds the client statistics are collected and sent to the cluster. Its default value is `3`. +As a prerequisite, you need to enable the client statistics in the Node.js client. +You can configure client statistics with `hazelcast.client.statistics.enabled` and `hazelcast.client.statistics.period.seconds` [properties](#31-client-properties). You can enable client statistics and set a non-default period in seconds as follows: @@ -3016,7 +3064,7 @@ After enabling the client statistics, you can monitor your clients using Hazelca ### 8.10.2. Logging Configuration - By default, Hazelcast Node.js client uses a default logger which logs to the `stdout` with the `INFO` log level. You can change the log level using the `hazelcast.logging.level` entry of the `properties` config option. +By default, Hazelcast Node.js client uses a default logger which logs to the `stdout` with the `INFO` log level. You can change the log level using the `hazelcast.logging.level` [property](#31-client-properties). Below is an example of the logging configuration with the `OFF` log level which disables logging. @@ -3028,7 +3076,7 @@ const cfg = { }; ``` - You can also implement a custom logger depending on your needs. Your custom logger must have `log`, `error`, `warn`, `info`, `debug`, `trace` methods. After implementing it, you can use your custom logger using the `customLogger` config option. +You can also implement a custom logger depending on your needs. Your custom logger must have `log`, `error`, `warn`, `info`, `debug`, `trace` methods. After implementing it, you can use your custom logger using the `customLogger` config option. See the following for a custom logger example. From af4346f47b3a49ed7d9f24883aa4a12a184b7d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 14:09:46 +0300 Subject: [PATCH 02/15] Add validation --- DOCUMENTATION.md | 7 ++-- src/config/Config.ts | 8 ++--- src/config/ConfigBuilder.ts | 72 ++++++++++++++++++++++++++++++++++--- 3 files changed, 74 insertions(+), 13 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 64549ac1f..51fcd327c 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -569,7 +569,7 @@ In the following chapters you will learn the description of all options supporte - `hazelcast.client.autopipelining.enabled`: Default value is `true`. Turns automated pipelining feature on/off. -If your application does only writes operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. +If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. - `hazelcast.client.autopipelining.threshold.bytes`: Default value is `65536` bytes (64 KB). This is the coalescing threshold for the internal queue used by automated pipelining. @@ -623,13 +623,10 @@ When set to `false`, the client will always use private addresses reported by me - `hazelcast.invalidation.max.tolerated.miss.count`: Default value is `10`. If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. -- `hazelcast.invalidation.min.reconciliation.interval.seconds`: -Minimum allowed value for `hazelcast.invalidation.reconciliation.interval.seconds`. - - `hazelcast.invalidation.reconciliation.interval.seconds`: Default value is `60` seconds. This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. -- `hazelcast.logging.level`: Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. +- `hazelcast.logging.level`: Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. Default value is `INFO`. # 4. Serialization diff --git a/src/config/Config.ts b/src/config/Config.ts index b2e12665f..7160dde76 100644 --- a/src/config/Config.ts +++ b/src/config/Config.ts @@ -154,7 +154,10 @@ export interface ClientConfig { } -/** @internal */ +/** + * If you are adding a new property, don't forget to add its validation in `handleProperties`. + * @internal + */ const DEFAULT_PROPERTIES: Properties = { 'hazelcast.client.heartbeat.interval': 5000, 'hazelcast.client.heartbeat.timeout': 60000, @@ -179,9 +182,6 @@ const DEFAULT_PROPERTIES: Properties = { 'hazelcast.discovery.public.ip.enabled': null, }; -/** @internal */ -export const PROPERTY_SET = new Set(Object.keys(DEFAULT_PROPERTIES)); - /** @internal */ export class ClientConfigImpl implements ClientConfig { properties: Properties = {...DEFAULT_PROPERTIES}; // Create a new object diff --git a/src/config/ConfigBuilder.ts b/src/config/ConfigBuilder.ts index 6f887c192..a5b655f80 100644 --- a/src/config/ConfigBuilder.ts +++ b/src/config/ConfigBuilder.ts @@ -25,7 +25,7 @@ import { tryGetNumber, tryGetString } from '../util/Util'; -import {ClientConfig, ClientConfigImpl, PROPERTY_SET} from './Config'; +import {ClientConfig, ClientConfigImpl} from './Config'; import {EvictionPolicy} from './EvictionPolicy'; import {FlakeIdGeneratorConfigImpl} from './FlakeIdGeneratorConfig'; import {InMemoryFormat} from './InMemoryFormat'; @@ -35,6 +35,7 @@ import {ReliableTopicConfigImpl} from './ReliableTopicConfig'; import {JsonStringDeserializationPolicy} from './JsonStringDeserializationPolicy'; import {ReconnectMode} from './ConnectionStrategyConfig'; import {LoadBalancerType} from './LoadBalancerConfig'; +import {LogLevel} from '../logging'; /** * Responsible for user-defined config validation. Builds the effective config with necessary defaults. @@ -223,10 +224,73 @@ export class ConfigBuilder { private handleProperties(jsonObject: any): void { for (const key in jsonObject) { - if (!PROPERTY_SET.has(key)) { - throw new RangeError(`Unexpected property '${key}' is passed to the Hazelcast Client`); + let value = jsonObject[key]; + try { + switch (key) { + case 'hazelcast.client.heartbeat.interval': + value = tryGetNumber(value); + break; + case 'hazelcast.client.heartbeat.timeout': + value = tryGetNumber(value); + break; + case 'hazelcast.client.invocation.retry.pause.millis': + value = tryGetNumber(value); + break; + case 'hazelcast.client.invocation.timeout.millis': + value = tryGetNumber(value); + break; + case 'hazelcast.client.internal.clean.resources.millis': + value = tryGetNumber(value); + break; + case 'hazelcast.client.cloud.url': + value = tryGetString(value); + break; + case 'hazelcast.client.statistics.enabled': + value = tryGetBoolean(value); + break; + case 'hazelcast.client.statistics.period.seconds': + value = tryGetNumber(value); + break; + case 'hazelcast.invalidation.reconciliation.interval.seconds': + value = tryGetNumber(value); + break; + case 'hazelcast.invalidation.max.tolerated.miss.count': + value = tryGetNumber(value); + break; + case 'hazelcast.logging.level': + value = tryGetEnum(LogLevel, value); + break; + case 'hazelcast.client.autopipelining.enabled': + value = tryGetBoolean(value); + break; + case 'hazelcast.client.autopipelining.threshold.bytes': + value = tryGetNumber(value); + break; + case 'hazelcast.client.socket.no.delay': + value = tryGetBoolean(value); + break; + case 'hazelcast.client.shuffle.member.list': + value = tryGetBoolean(value); + break; + case 'hazelcast.client.operation.backup.timeout.millis': + value = tryGetNumber(value); + break; + case 'hazelcast.client.operation.fail.on.indeterminate.state': + value = tryGetBoolean(value); + break; + case 'hazelcast.discovery.public.ip.enabled': + if (value !== null || typeof value !== 'boolean') { + throw new RangeError(`${value} is not null or a boolean.`); + } + break; + default: + throw new RangeError(`Unexpected property '${key}' is passed to the Hazelcast Client`); + } + } catch (e) { + throw new RangeError(`Property validation error: Property: ${key}, value: ${value}. Error: ${e}`); } - this.effectiveConfig.properties[key] = jsonObject[key]; + + this.effectiveConfig.properties[key] = value; } } From 3164e5990f1bd49b58fa41694a851b9f3b2c411e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 14:15:07 +0300 Subject: [PATCH 03/15] fixes --- src/config/ConfigBuilder.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigBuilder.ts b/src/config/ConfigBuilder.ts index a5b655f80..df3ef1397 100644 --- a/src/config/ConfigBuilder.ts +++ b/src/config/ConfigBuilder.ts @@ -257,8 +257,11 @@ export class ConfigBuilder { case 'hazelcast.invalidation.max.tolerated.miss.count': value = tryGetNumber(value); break; + case 'hazelcast.invalidation.min.reconciliation.interval.seconds': + value = tryGetNumber(value); + break; case 'hazelcast.logging.level': - value = tryGetEnum(LogLevel, value); + tryGetEnum(LogLevel, value); // only validate break; case 'hazelcast.client.autopipelining.enabled': value = tryGetBoolean(value); From 08ee80da41cdc1cd0d51e1aa8a6eef3a19c95170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 14:32:01 +0300 Subject: [PATCH 04/15] Convert to table --- DOCUMENTATION.md | 83 ++++++++++++++---------------------------------- 1 file changed, 23 insertions(+), 60 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 51fcd327c..bd9f89ed4 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -567,66 +567,29 @@ In the following chapters you will learn the description of all options supporte # 3.1 Client Properties -- `hazelcast.client.autopipelining.enabled`: -Default value is `true`. Turns automated pipelining feature on/off. -If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. - -- `hazelcast.client.autopipelining.threshold.bytes`: -Default value is `65536` bytes (64 KB). This is the coalescing threshold for the internal queue used by automated pipelining. -Once the total size of operation payloads taken from the queue reaches this value during batch preparation, -these operations are written to the socket. Notice that automated pipelining will still send operations if their total size -is smaller than the threshold and there are no more operations in the internal queue. - -- `hazelcast.client.cloud.url`: Hazelcast Cloud URL. Default value is `https://coordinator.hazelcast.cloud`. - -- `hazelcast.client.heartbeat.interval`: -Frequency of the heartbeat messages sent by the clients to members. Default value is `5000` milliseconds. - -- `hazelcast.client.heartbeat.timeout`: -Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member -within the given time via this property in milliseconds, the connection will be closed. Default value is `60000` milliseconds. - -- `hazelcast.client.invocation.retry.pause.millis`: -Pause time between each retry cycle of an invocation in milliseconds. Default value is `1000` milliseconds. - -- `hazelcast.client.invocation.timeout.millis`: -Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. Default value is `120000` milliseconds. - -- `hazelcast.client.operation.backup.timeout.millis`: Default value is `5000` milliseconds. If an operation has -backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. -If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. - -- `hazelcast.client.operation.fail.on.indeterminate.state`: -Default value is `false`. When it is `true`, if an operation has sync backups and acks are not received -from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, -then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. - -- `hazelcast.client.shuffle.member.list`: -The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. -When it is set to false, the client tries to connect to the members in the given order. Default value is `true`. - -- `hazelcast.client.socket.no.delay`: -The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. Default value is `true`. - -- `hazelcast.client.statistics.enabled`: -If set to `true`, it enables collecting the client statistics and sending them to the cluster. -When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. -Its default value is `false`. - -- `hazelcast.client.statistics.period.seconds`: -Period in seconds the client statistics are collected and sent to the cluster. Its default value is `3`. - -- `hazelcast.discovery.public.ip.enabled`: -Default value is `null` (detection enabled). When set to `true`, the client will assume that it needs to use public IP addresses reported by members. -When set to `false`, the client will always use private addresses reported by members. - -- `hazelcast.invalidation.max.tolerated.miss.count`: -Default value is `10`. If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. - -- `hazelcast.invalidation.reconciliation.interval.seconds`: Default value is `60` seconds. -This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. - -- `hazelcast.logging.level`: Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. Default value is `INFO`. +The following is the list of all client properties in alphabetical order. + +> **NOTE: When you want to reconfigure a client property, you need to restart the client.** + +| Property Name | Default Value | Type | Description | +|--------------------------------------------------------|-------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | +| hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | +| hazelcast.client.cloud.url | https://coordinator.hazelcast.cloud | string | Hazelcast Cloud URL. | +| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | +| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | +| hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | +| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. | +| hazelcast.client.operation.backup.timeout.millis | 5000 | number | If an operation has backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. | +| hazelcast.client.operation.fail.on.indeterminate.state | false | boolean | When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. | +| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. When it is set to false, the client tries to connect to the members in the given order. | +| hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | +| hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | +| hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | +| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. | +| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. | +| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | +| hazelcast.logging.level | INFO | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | # 4. Serialization From a885b8e309d858fc2cd1246a7b2990365999a31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 14:33:45 +0300 Subject: [PATCH 05/15] Fix table --- DOCUMENTATION.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index bd9f89ed4..503d024b8 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -571,25 +571,25 @@ The following is the list of all client properties in alphabetical order. > **NOTE: When you want to reconfigure a client property, you need to restart the client.** -| Property Name | Default Value | Type | Description | -|--------------------------------------------------------|-------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | -| hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | -| hazelcast.client.cloud.url | https://coordinator.hazelcast.cloud | string | Hazelcast Cloud URL. | -| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | -| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | -| hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | -| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. | -| hazelcast.client.operation.backup.timeout.millis | 5000 | number | If an operation has backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. | -| hazelcast.client.operation.fail.on.indeterminate.state | false | boolean | When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. | -| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. When it is set to false, the client tries to connect to the members in the given order. | -| hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | -| hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | -| hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | -| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. | -| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. | -| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | -| hazelcast.logging.level | INFO | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | +| Property Name | Default Value | Type | Description | +|--------------------------------------------------------|---------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | +| hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | +| hazelcast.client.cloud.url | 'https://coordinator.hazelcast.cloud' | string | Hazelcast Cloud URL. | +| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | +| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | +| hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | +| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. | +| hazelcast.client.operation.backup.timeout.millis | 5000 | number | If an operation has backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. | +| hazelcast.client.operation.fail.on.indeterminate.state | false | boolean | When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. | +| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. When it is set to false, the client tries to connect to the members in the given order. | +| hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | +| hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | +| hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | +| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. | +| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. | +| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | +| hazelcast.logging.level | 'INFO' | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | # 4. Serialization From 221db0a45620ad769e43f571a1c2b6d178a4b97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 14:35:22 +0300 Subject: [PATCH 06/15] Revert "Fix table" This reverts commit a885b8e309d858fc2cd1246a7b2990365999a31c. --- DOCUMENTATION.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 503d024b8..bd9f89ed4 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -571,25 +571,25 @@ The following is the list of all client properties in alphabetical order. > **NOTE: When you want to reconfigure a client property, you need to restart the client.** -| Property Name | Default Value | Type | Description | -|--------------------------------------------------------|---------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | -| hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | -| hazelcast.client.cloud.url | 'https://coordinator.hazelcast.cloud' | string | Hazelcast Cloud URL. | -| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | -| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | -| hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | -| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. | -| hazelcast.client.operation.backup.timeout.millis | 5000 | number | If an operation has backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. | -| hazelcast.client.operation.fail.on.indeterminate.state | false | boolean | When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. | -| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. When it is set to false, the client tries to connect to the members in the given order. | -| hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | -| hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | -| hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | -| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. | -| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. | -| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | -| hazelcast.logging.level | 'INFO' | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | +| Property Name | Default Value | Type | Description | +|--------------------------------------------------------|-------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | +| hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | +| hazelcast.client.cloud.url | https://coordinator.hazelcast.cloud | string | Hazelcast Cloud URL. | +| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | +| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | +| hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | +| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. | +| hazelcast.client.operation.backup.timeout.millis | 5000 | number | If an operation has backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. | +| hazelcast.client.operation.fail.on.indeterminate.state | false | boolean | When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. | +| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. When it is set to false, the client tries to connect to the members in the given order. | +| hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | +| hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | +| hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | +| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. | +| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. | +| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | +| hazelcast.logging.level | INFO | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | # 4. Serialization From 45a466f900fb93066da429ef690dddb562566d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 14:42:48 +0300 Subject: [PATCH 07/15] Add check for markdown link checker --- DOCUMENTATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index bd9f89ed4..f58dbc6aa 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -575,7 +575,7 @@ The following is the list of all client properties in alphabetical order. |--------------------------------------------------------|-------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | | hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | -| hazelcast.client.cloud.url | https://coordinator.hazelcast.cloud | string | Hazelcast Cloud URL. | +| hazelcast.client.cloud.url | https://coordinator.hazelcast.cloud | string | Hazelcast Cloud URL. | | hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | | hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | | hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | From a387aa1dab8fb6ae28e92cc3059d50cef1b4350a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 2 Aug 2021 18:20:41 +0300 Subject: [PATCH 08/15] Fix --- src/config/ConfigBuilder.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/ConfigBuilder.ts b/src/config/ConfigBuilder.ts index df3ef1397..50e746365 100644 --- a/src/config/ConfigBuilder.ts +++ b/src/config/ConfigBuilder.ts @@ -282,7 +282,7 @@ export class ConfigBuilder { value = tryGetBoolean(value); break; case 'hazelcast.discovery.public.ip.enabled': - if (value !== null || typeof value !== 'boolean') { + if (value !== null && typeof value !== 'boolean') { throw new RangeError(`${value} is not null or a boolean.`); } break; From c980b4d75dfa4b763a6fbb601e4904140e31da80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Fri, 6 Aug 2021 13:40:32 +0300 Subject: [PATCH 09/15] partial addressing of comments --- DOCUMENTATION.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index f58dbc6aa..9d09096b4 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -569,25 +569,22 @@ In the following chapters you will learn the description of all options supporte The following is the list of all client properties in alphabetical order. -> **NOTE: When you want to reconfigure a client property, you need to restart the client.** - | Property Name | Default Value | Type | Description | |--------------------------------------------------------|-------------------------------------|-----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | hazelcast.client.autopipelining.enabled | true | boolean | Turns automated pipelining feature on/off. If your application does only write operations, like `IMap.set()`, you can try disabling automated pipelining to get a slightly better throughput. | | hazelcast.client.autopipelining.threshold.bytes | 65536 (64 KB) | number | This is the coalescing threshold for the internal queue used by automated pipelining. Once the total size of operation payloads taken from the queue reaches this value during batch preparation, these operations are written to the socket. Notice that automated pipelining will still send operations if their total size is smaller than the threshold and there are no more operations in the internal queue. | -| hazelcast.client.cloud.url | https://coordinator.hazelcast.cloud | string | Hazelcast Cloud URL. | -| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members. | -| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members. If no messages pass between the client and member within the given time via this property in milliseconds, the connection will be closed. | +| hazelcast.client.heartbeat.interval | 5000 | number | Frequency of the heartbeat messages sent by the clients to members in milliseconds. | +| hazelcast.client.heartbeat.timeout | 60000 | number | Timeout for the heartbeat messages sent by the client to members in milliseconds. If no messages pass between the client and member within the given time via this property, the connection will be closed. | | hazelcast.client.invocation.retry.pause.millis | 1000 | number | Pause time between each retry cycle of an invocation in milliseconds. | -| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable. | +| hazelcast.client.invocation.timeout.millis | 120000 | number | Period, in milliseconds, to give up the invocation when a member in the member list is not reachable, member throws an exception or client's heartbeat requests are timed out. | | hazelcast.client.operation.backup.timeout.millis | 5000 | number | If an operation has backups, this property specifies how long (in milliseconds) the invocation waits for acks from the backup replicas. If acks are not received from some of the backups, there will not be any rollback on the other successful replicas. | | hazelcast.client.operation.fail.on.indeterminate.state | false | boolean | When it is `true`, if an operation has sync backups and acks are not received from backup replicas in time, or the member which owns primary replica of the target partition leaves the cluster, then the invocation fails. However, even if the invocation fails, there will not be any rollback on other successful replicas. | -| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is true. When it is set to false, the client tries to connect to the members in the given order. | +| hazelcast.client.shuffle.member.list | true | boolean | The client shuffles the given member list to prevent all the clients to connect to the same member when this property is `true`. When it is set to `false`, the client tries to connect to the members in the given order. | | hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | | hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | | hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | -| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. | -| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data will be made unreachable. | +| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. If it is null, the client will try to infer how the cluster is structured and act accordingly. This inference is not %100 reliable and may result in false-negatives. | +| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data in a near cache will be made unreachable. | | hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | | hazelcast.logging.level | INFO | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | From ef07339c4362499edaa6805fc386bc9dde28dbd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Tue, 10 Aug 2021 13:15:44 +0300 Subject: [PATCH 10/15] Adjust logging level assignment --- src/HazelcastClient.ts | 3 ++- src/config/Config.ts | 4 ++-- src/config/ConfigBuilder.ts | 2 +- src/logging/LoggingService.ts | 4 +--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/HazelcastClient.ts b/src/HazelcastClient.ts index 04a98a097..55a6153fc 100644 --- a/src/HazelcastClient.ts +++ b/src/HazelcastClient.ts @@ -66,6 +66,7 @@ import {ClientMessage} from './protocol/ClientMessage'; import {Connection} from './network/Connection'; import {ConnectionRegistryImpl} from './network/ConnectionManager'; import {SqlService, SqlServiceImpl} from './sql/SqlService'; +import {LogLevel} from './logging'; /** * Hazelcast client instance. When you want to use Hazelcast's distributed @@ -141,7 +142,7 @@ export class HazelcastClient { this.serializationService = new SerializationServiceV1(this.config.serialization); this.instanceName = this.config.instanceName || 'hz.client_' + this.id; this.loggingService = new LoggingService(this.config.customLogger, - this.config.properties['hazelcast.logging.level'] as string); + this.config.properties['hazelcast.logging.level'] as LogLevel); this.nearCacheManager = new NearCacheManager( this.config, this.serializationService diff --git a/src/config/Config.ts b/src/config/Config.ts index 7160dde76..20010987d 100644 --- a/src/config/Config.ts +++ b/src/config/Config.ts @@ -24,7 +24,7 @@ import {Properties} from './Properties'; import {ReliableTopicConfig, ReliableTopicConfigImpl} from './ReliableTopicConfig'; import {SerializationConfig, SerializationConfigImpl} from './SerializationConfig'; import {Statistics} from '../statistics/Statistics'; -import {ILogger} from '../logging/ILogger'; +import {ILogger, LogLevel} from '../logging/ILogger'; import {ConnectionStrategyConfig, ConnectionStrategyConfigImpl} from './ConnectionStrategyConfig'; import {LoadBalancerConfig, LoadBalancerConfigImpl} from './LoadBalancerConfig'; @@ -170,7 +170,7 @@ const DEFAULT_PROPERTIES: Properties = { 'hazelcast.invalidation.reconciliation.interval.seconds': 60, 'hazelcast.invalidation.max.tolerated.miss.count': 10, 'hazelcast.invalidation.min.reconciliation.interval.seconds': 30, - 'hazelcast.logging.level': 'INFO', + 'hazelcast.logging.level': LogLevel.INFO, 'hazelcast.client.autopipelining.enabled': true, 'hazelcast.client.autopipelining.threshold.bytes': 65536, 'hazelcast.client.socket.no.delay': true, diff --git a/src/config/ConfigBuilder.ts b/src/config/ConfigBuilder.ts index 50e746365..59de409d0 100644 --- a/src/config/ConfigBuilder.ts +++ b/src/config/ConfigBuilder.ts @@ -261,7 +261,7 @@ export class ConfigBuilder { value = tryGetNumber(value); break; case 'hazelcast.logging.level': - tryGetEnum(LogLevel, value); // only validate + value = tryGetEnum(LogLevel, value); break; case 'hazelcast.client.autopipelining.enabled': value = tryGetBoolean(value); diff --git a/src/logging/LoggingService.ts b/src/logging/LoggingService.ts index 68e350286..10eae98c3 100644 --- a/src/logging/LoggingService.ts +++ b/src/logging/LoggingService.ts @@ -18,16 +18,14 @@ import {Property} from '../config/Properties'; import {DefaultLogger} from './DefaultLogger'; import {ILogger, LogLevel} from './ILogger'; -import {enumFromString} from '../util/Util'; /** @internal */ export class LoggingService { private readonly logger: ILogger; - constructor(customLogger: ILogger, level: string) { + constructor(customLogger: ILogger, logLevel: LogLevel) { if (customLogger == null) { - const logLevel = enumFromString(LogLevel, level); this.logger = new DefaultLogger(logLevel); } else if (this.isLogger(customLogger)) { this.logger = customLogger; From 931dafc7c31897b5d6d490bb2ad321a45eeafb98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Tue, 10 Aug 2021 15:26:17 +0300 Subject: [PATCH 11/15] Fix test runner --- scripts/test-runner.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/test-runner.js b/scripts/test-runner.js index 8cf1b0db7..9422de08c 100644 --- a/scripts/test-runner.js +++ b/scripts/test-runner.js @@ -113,7 +113,6 @@ const startRC = async () => { const shutdownProcesses = () => { console.log('Stopping remote controller and test processes...'); - shutdownRC(); if (ON_WINDOWS) { spawnSync('taskkill', ['/pid', testProcess.pid, '/f', '/t']); // simple sigkill not enough on windows } else { @@ -121,6 +120,7 @@ const shutdownProcesses = () => { testProcess.kill('SIGKILL'); } } + shutdownRC(); }; const shutdownRC = () => { @@ -131,6 +131,7 @@ const shutdownRC = () => { rcProcess.kill('SIGKILL'); } } + process.exit(testProcess.exitCode); }; if (process.argv.length === 3 || process.argv.length === 4) { @@ -182,11 +183,11 @@ if (!fs.existsSync('./lib')) { // If running unit test, no need to start rc. if (testType === 'unit') { console.log(`Running unit tests... Test command: ${testCommand}`); - spawnSync(testCommand, [], { + const subprocess = spawnSync(testCommand, [], { stdio: ['ignore', 'inherit', 'inherit'], shell: true }); - process.exit(0); + process.exit(subprocess.status); } // For other tests, download rc files if needed. From 6261e96d49a753d31ad2e16727e7dfbaff55a72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Tue, 10 Aug 2021 15:43:48 +0300 Subject: [PATCH 12/15] Documentation and test update --- DOCUMENTATION.md | 6 +++--- test/unit/config/ConfigBuilderTest.js | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 9d09096b4..27f5cf975 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -583,9 +583,9 @@ The following is the list of all client properties in alphabetical order. | hazelcast.client.socket.no.delay | true | boolean | The [setNoDelay](https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay) setting for connections. | | hazelcast.client.statistics.enabled | false | boolean | If set to `true`, it enables collecting the client statistics and sending them to the cluster. When it is `true` you can monitor the clients that are connected to your Hazelcast cluster, using Hazelcast Management Center. | | hazelcast.client.statistics.period.seconds | 3 | number | Period in seconds the client statistics are collected and sent to the cluster. | -| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. If it is null, the client will try to infer how the cluster is structured and act accordingly. This inference is not %100 reliable and may result in false-negatives. | -| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data in a near cache will be made unreachable. | -| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | This is a periodic task that scans cluster members periodically to compare generated invalidation events with the received ones from the client Near Cache. | +| hazelcast.discovery.public.ip.enabled | null(detection enabled) | boolean or null | When set to `true`, the client will assume that it needs to use public IP addresses reported by members. When set to `false`, the client will always use private addresses reported by members. If it is `null`, the client will try to infer how the discovery mechanism should be based on the reachability of the members. This inference is not %100 reliable and may result in false negatives. | +| hazelcast.invalidation.max.tolerated.miss.count | 10 | number | If missed invalidation count is bigger than this value, relevant cached data in a Near Cache will be made unreachable. | +| hazelcast.invalidation.reconciliation.interval.seconds | 60 | number | Period of the task that scans cluster members to compare generated invalidation events with the received ones from the client Near Cache. | | hazelcast.logging.level | INFO | string | Logging level. Can be one of `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`. | # 4. Serialization diff --git a/test/unit/config/ConfigBuilderTest.js b/test/unit/config/ConfigBuilderTest.js index a91600c61..f15ac6d8c 100644 --- a/test/unit/config/ConfigBuilderTest.js +++ b/test/unit/config/ConfigBuilderTest.js @@ -32,6 +32,7 @@ const { createAddressFromString } = require('../../../lib/util/AddressUtil'); const { ReconnectMode } = require('../../../lib/config/ConnectionStrategyConfig'); +const { LogLevel } = require('../../../lib/logging/ILogger'); describe('ConfigBuilderTest', function () { @@ -152,7 +153,7 @@ describe('ConfigBuilderTest', function () { expect(properties['hazelcast.invalidation.reconciliation.interval.seconds']).equal(50); expect(properties['hazelcast.invalidation.max.tolerated.miss.count']).to.equal(15); expect(properties['hazelcast.invalidation.min.reconciliation.interval.seconds']).to.equal(60); - expect(properties['hazelcast.logging.level']).to.be.equal('OFF'); + expect(properties['hazelcast.logging.level']).to.be.equal(LogLevel.OFF); expect(properties['hazelcast.client.autopipelining.enabled']).to.be.false; expect(properties['hazelcast.client.autopipelining.threshold.bytes']).to.equal(1024); expect(properties['hazelcast.client.socket.no.delay']).to.be.false; From b49107d4dfae856491b786fb0443227ba6795662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Tue, 10 Aug 2021 16:14:12 +0300 Subject: [PATCH 13/15] Update test runner --- scripts/test-runner.js | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/scripts/test-runner.js b/scripts/test-runner.js index 98e687d10..a3ffa4147 100644 --- a/scripts/test-runner.js +++ b/scripts/test-runner.js @@ -127,8 +127,22 @@ const startRC = async () => { throw `Could not reach to Hazelcast Remote Controller (127.0.0.1:9701) after trying ${retryCount} times.`; }; -const shutdownProcesses = () => { - console.log('Stopping remote controller and test processes...'); +const shutdown = async () => { + if (testProcess && testProcess.exitCode === null) { + stopTestProcess(); + } + + if (rcProcess && rcProcess.exitCode === null) { + await stopRC(); + } + + if (testProcess && testProcess.exitCode !== null) { + process.exit(testProcess.exitCode); + } +}; + +const stopTestProcess = () => { + console.log('Stopping test process'); if (ON_WINDOWS) { spawnSync('taskkill', ['/pid', testProcess.pid, '/f', '/t']); // simple sigkill not enough on windows } else { @@ -136,10 +150,10 @@ const shutdownProcesses = () => { testProcess.kill('SIGKILL'); } } - shutdownRC(); }; -const shutdownRC = async () => { +const stopRC = async () => { + console.log('Stopping cluster and remote controller'); if (cluster) { const RC = getRC(); await RC.terminateCluster(cluster.id); @@ -151,7 +165,6 @@ const shutdownRC = async () => { rcProcess.kill('SIGKILL'); } } - process.exit(testProcess.exitCode); }; if (process.argv.length === 3 || process.argv.length === 4) { @@ -221,9 +234,9 @@ try { throw err; } -process.on('SIGINT', shutdownProcesses); -process.on('SIGTERM', shutdownProcesses); -process.on('SIGHUP', shutdownProcesses); +process.on('SIGINT', shutdown); +process.on('SIGTERM', shutdown); +process.on('SIGHUP', shutdown); startRC().then(async () => { console.log('Hazelcast Remote Controller is started!'); @@ -233,17 +246,20 @@ startRC().then(async () => { stdio: ['ignore', 'inherit', 'inherit'], shell: true }); - testProcess.on('exit', shutdownRC); + testProcess.on('exit', shutdown); } else if (testType === 'check-code-samples') { const RC = getRC(); cluster = await RC.createClusterKeepClusterName(null, DEV_CLUSTER_CONFIG); + let exitCode = 0; try { await codeSampleChecker.main(cluster); } catch (e) { console.error(e); - process.exit(1); + exitCode = 1; } finally { - await shutdownRC(); + await shutdown(); + // testProcess is undefined `shutdown` won't exit the process, so we exit with non-zero error code + process.exit(exitCode); } } }).catch(err => { From c0a5825729bd1e2398f23991d801e14f462b0a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Mon, 16 Aug 2021 18:21:18 +0300 Subject: [PATCH 14/15] Add padded-blocks never --- test/.eslintrc | 3 +- test/TestUtil.js | 2 - test/integration/ClientShutdownTest.js | 1 - test/integration/ConnectionManagerTest.js | 1 - .../ConnectionManagerTranslateTest.js | 1 - .../AutoPipeliningDisabledTest.js | 1 - .../ClientBackupAcksTest.js | 1 - .../backward_compatible/ClientFailoverTest.js | 2 - .../ClientHotRestartEventTest.js | 1 - .../backward_compatible/ClientLabelTest.js | 2 - .../ClientReconnectAdvancedTest.js | 2 - .../ClientReconnectTest.js | 1 - .../ClientRedoEnabledTest.js | 1 - .../backward_compatible/ClusterServiceTest.js | 1 - .../ConnectionStrategyTest.js | 1 - .../DistributedObjectsTest.js | 1 - .../HazelcastClientTest.js | 3 - .../InitialMembershipListenerTest.js | 1 - .../LifecycleServiceTest.js | 1 - .../ListenerServiceTest.js | 1 - .../ListenersOnReconnectTest.js | 2 - .../backward_compatible/LoggingTest.js | 1 - .../backward_compatible/LostConnectionTest.js | 1 - .../MembershipListenerTest.js | 1 - .../cpsubsystem/AtomicLongTest.js | 1 - .../cpsubsystem/AtomicReferenceTest.js | 1 - .../cpsubsystem/CountDownLatchTest.js | 1 - .../cpsubsystem/FencedLockTest.js | 1 - .../cpsubsystem/SemaphoreCommonTest.js | 2 - .../cpsubsystem/SessionAwareSemaphoreTest.js | 1 - .../cpsubsystem/SessionlessSemaphoreTest.js | 1 - .../flakeid/FlakeIdGeneratorOutOfRangeTest.js | 1 - .../flakeid/FlakeIdGeneratorProxyTest.js | 1 - .../HJVHazelcastJsonValueSerializerTest.js | 1 - .../HJVJsonSerializerTest.js | 1 - .../HazelcastJsonValueQueryTest.js | 1 - .../backward_compatible/list/ListProxyTest.js | 1 - .../map/MapAggregatorsDoubleTest.js | 1 - .../map/MapAggregatorsIntTest.js | 1 - .../map/MapAggregatorsLongTest.js | 1 - .../map/MapEntryProcessorTest.js | 1 - .../backward_compatible/map/MapLockTest.js | 1 - .../map/MapPartitionAwareTest.js | 1 - .../map/MapPredicateTest.js | 1 - .../backward_compatible/map/MapProxyTest.js | 1 - .../backward_compatible/map/MapStoreTest.js | 1 - .../map/NearCachedMapStressTest.js | 1 - .../map/NearCachedMapTest.js | 2 - .../multimap/MultiMapProxyListenersTest.js | 2 - .../multimap/MultiMapProxyLockTest.js | 1 - .../multimap/MultiMapProxyTest.js | 2 - .../InvalidationMetadataDistortionTest.js | 1 - .../nearcache/MigratedDataTest.js | 1 - .../NearCacheSimpleInvalidationTest.js | 1 - .../nearcache/NonStopNearCache.js | 2 - .../pncounter/PNCounterBasicTest.js | 1 - .../pncounter/PNCounterConsistencyTest.js | 1 - .../pncounter/PNCounterWithLiteMembersTest.js | 1 - .../queue/QueueProxyTest.js | 1 - .../replicatedmap/ReplicatedMapProxyTest.js | 3 - .../rest_value/RestValueTest.js | 1 - .../ringbuffer/RingbufferProxyTest.js | 1 - .../CustomSerializerConfigTest.js | 1 - .../DefaultSerializersLiveTest.js | 1 - .../serialization/FactoriesTest.js | 1 - .../PortableSerializersLiveTest.js | 1 - .../backward_compatible/set/SetProxyTest.js | 1 - .../backward_compatible/sql/DataTypeTest.js | 1 - .../backward_compatible/sql/ExecuteTest.js | 1 - .../backward_compatible/sql/RowTest.js | 1 - .../ssl/ClientSSLAuthenticationTest.js | 2 - .../backward_compatible/ssl/ClientSSLTest.js | 1 - .../statistics/StatisticsTest.js | 3 - .../topic/ReliableTopicOnClusterRestart.js | 1 - .../topic/ReliableTopicTest.js | 1 - .../heartbeat/HeartbeatFromClientTest.js | 1 - .../heartbeat/HeartbeatFromServerTest.js | 1 - .../nearcache/LostInvalidationsTest.js | 1 - .../nearcache/RepairingTaskTest.js | 1 - test/unit/ClientProxyTest.js | 1 - .../unit/ClusterFailoverServiceBuilderTest.js | 1 - test/unit/ClusterFailoverServiceTest.js | 1 - test/unit/RepetitionTaskTest.js | 1 - .../codec/builtin/FixSizedTypesCodecTest.js | 1 - .../config/ConfigBuilderHazelcastCloudTest.js | 1 - test/unit/config/ConfigBuilderSSLTest.js | 1 - test/unit/config/ConfigBuilderTest.js | 81 ++++++++++++++++++- test/unit/config/ConfigPatternMatcherTest.js | 1 - test/unit/config/FailoverConfigBuilderTest.js | 1 - test/unit/config/SchemaValidationTest.js | 1 - .../connection/ClientMessageReaderTest.js | 1 - .../connection/DefaultAddressProviderTest.js | 1 - test/unit/connection/DirectWriterTest.js | 2 - .../FragmentedClientMessageHandlerTest.js | 2 - test/unit/connection/PipelinedWriterTest.js | 1 - test/unit/core/BigDecimal.js | 1 - test/unit/core/DatetimeClasses.js | 2 - test/unit/core/UuidTest.js | 1 - .../discovery/HazelcastCloudConfigTest.js | 1 - .../discovery/HazelcastCloudDiscoveryTest.js | 1 - .../discovery/HazelcastCloudProviderTest.js | 2 - test/unit/invocation/InvocationServiceTest.js | 1 - test/unit/invocation/InvocationTest.js | 1 - test/unit/invocation/MurmurTest.js | 1 - test/unit/nearcache/NearCacheTest.js | 4 - test/unit/network/ConnectionRegistryTest.js | 2 - .../network/TranslateAddressProviderTest.js | 1 - test/unit/protocol/ClientErrorFactoryTest.js | 1 - test/unit/protocol/ClientMessageTest.js | 1 - .../proxy/cpsubsystem/CPProxyManagerTest.js | 1 - .../proxy/cpsubsystem/CPSessionManagerTest.js | 3 - .../proxy/cpsubsystem/FencedLockProxyTest.js | 1 - .../cpsubsystem/SemaphoreProxyCommonTest.js | 2 - .../SessionAwareSemaphoreProxyTest.js | 1 - test/unit/ringbuffer/LazyReadResultSetTest.js | 1 - test/unit/serialization/APortable.js | 1 - .../AnIdentifiedDataSerializable.js | 2 - .../serialization/BinaryCompatibilityTest.js | 1 - .../serialization/CustomSerializerTest.js | 1 - .../serialization/DefaultSerializersTest.js | 1 - .../serialization/GlobalSerializerTest.js | 1 - .../IdentifiedDataSerializableTest.js | 3 - .../unit/serialization/JsonSerializersTest.js | 1 - test/unit/serialization/ObjectDataTest.js | 1 - test/unit/serialization/PortableObjects.js | 16 ---- .../PortableSerializationTest.js | 1 - .../serialization/SerializationServiceTest.js | 1 - .../portable/ClassDefinitionTest.js | 1 - .../portable/NestedPortableVersionTest.js | 1 - test/unit/sql/SqlPage.js | 1 - test/unit/sql/SqlResult.js | 8 -- test/unit/sql/SqlService.js | 5 -- test/unit/ssl/BasicSSLOptionsFactoryTest.js | 1 - test/unit/statistics/MetricsCompressorTest.js | 3 - test/unit/util/AddressUtilTest.js | 1 - test/unit/util/DatetimeUtil.js | 1 - test/unit/util/LoadBalancerTest.js | 1 - test/unit/util/UtilTest.js | 1 - 138 files changed, 82 insertions(+), 197 deletions(-) diff --git a/test/.eslintrc b/test/.eslintrc index 9f24898dd..b02a8fbb8 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -17,7 +17,8 @@ "max-len": ["warn", 130], "mocha/prefer-arrow-callback": ["error", { "allowNamedFunctions": true - }] + }], + "padded-blocks": ["error", "never"] }, "parserOptions": { "ecmaVersion": 11 diff --git a/test/TestUtil.js b/test/TestUtil.js index e17bd4ca5..6ed9e6361 100644 --- a/test/TestUtil.js +++ b/test/TestUtil.js @@ -200,7 +200,6 @@ exports.randomString = function (length) { }; class CountingMembershipListener { - constructor(expectedAdds, expectedRemoves) { this.adds = 0; this.expectedAdds = expectedAdds; @@ -230,7 +229,6 @@ class CountingMembershipListener { } this._resolve(); } - } exports.CountingMembershipListener = CountingMembershipListener; diff --git a/test/integration/ClientShutdownTest.js b/test/integration/ClientShutdownTest.js index ec0046c00..f29367590 100644 --- a/test/integration/ClientShutdownTest.js +++ b/test/integration/ClientShutdownTest.js @@ -31,7 +31,6 @@ const { ConnectionManager } = require('../../lib/network/ConnectionManager'); const { InvocationService } = require('../../lib/invocation/InvocationService'); describe('ClientShutdownTest', function () { - let cluster; afterEach(async function () { diff --git a/test/integration/ConnectionManagerTest.js b/test/integration/ConnectionManagerTest.js index 226bc8171..1d601d013 100644 --- a/test/integration/ConnectionManagerTest.js +++ b/test/integration/ConnectionManagerTest.js @@ -31,7 +31,6 @@ const { promiseWaitMilliseconds } = require('../TestUtil'); * Basic tests for `ConnectionManager`. */ describe('ConnectionManagerTest', function () { - let cluster; let client; let server; diff --git a/test/integration/ConnectionManagerTranslateTest.js b/test/integration/ConnectionManagerTranslateTest.js index b63e66a16..663c7c68e 100644 --- a/test/integration/ConnectionManagerTranslateTest.js +++ b/test/integration/ConnectionManagerTranslateTest.js @@ -30,7 +30,6 @@ const { EndpointQualifier, ProtocolType } = require('../../lib/core/EndpointQual * Tests address translation done by `ConnectionManager`. */ describe('ConnectionManagerTranslateTest', function () { - const PROPERTY_DISCOVERY_PUBLIC_IP_ENABLED = 'hazelcast.discovery.public.ip.enabled'; const REACHABLE_HOST = '127.0.0.1'; const UNREACHABLE_HOST = '192.168.0.1'; diff --git a/test/integration/backward_compatible/AutoPipeliningDisabledTest.js b/test/integration/backward_compatible/AutoPipeliningDisabledTest.js index d32db5822..c9ad54871 100644 --- a/test/integration/backward_compatible/AutoPipeliningDisabledTest.js +++ b/test/integration/backward_compatible/AutoPipeliningDisabledTest.js @@ -20,7 +20,6 @@ const RC = require('../RC'); const { Client } = require('../../../'); describe('AutoPipeliningDisabledTest', function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/ClientBackupAcksTest.js b/test/integration/backward_compatible/ClientBackupAcksTest.js index d714e79d4..23cdba0e1 100644 --- a/test/integration/backward_compatible/ClientBackupAcksTest.js +++ b/test/integration/backward_compatible/ClientBackupAcksTest.js @@ -32,7 +32,6 @@ const { ClientLocalBackupListenerCodec } = require('../../../lib/codec/ClientLoc * so there is no need for additional member side configuration. */ describe('ClientBackupAcksTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/ClientFailoverTest.js b/test/integration/backward_compatible/ClientFailoverTest.js index 1d742549b..d19cd6a5a 100644 --- a/test/integration/backward_compatible/ClientFailoverTest.js +++ b/test/integration/backward_compatible/ClientFailoverTest.js @@ -64,7 +64,6 @@ function createClientConfig({ clusterName, lifecycleListener, connectTimeoutMs } * Tests blue/green failover support for OSS. */ describe('ClientFailoverTest - community', function () { - let cluster1; let cluster2; @@ -101,7 +100,6 @@ describe('ClientFailoverTest - community', function () { * Tests blue/green failover support for EE. */ describe('ClientFailoverTest - enterprise', function () { - let cluster1; let member1; let cluster2; diff --git a/test/integration/backward_compatible/ClientHotRestartEventTest.js b/test/integration/backward_compatible/ClientHotRestartEventTest.js index 997345f17..26972a449 100644 --- a/test/integration/backward_compatible/ClientHotRestartEventTest.js +++ b/test/integration/backward_compatible/ClientHotRestartEventTest.js @@ -26,7 +26,6 @@ const TestUtil = require('../../TestUtil'); * This test assumes cluster with a single member. */ describe('ClientHotRestartEventTest', function () { - let client; let cluster; diff --git a/test/integration/backward_compatible/ClientLabelTest.js b/test/integration/backward_compatible/ClientLabelTest.js index b5e378245..391e75ae0 100644 --- a/test/integration/backward_compatible/ClientLabelTest.js +++ b/test/integration/backward_compatible/ClientLabelTest.js @@ -21,7 +21,6 @@ const RC = require('./../RC'); const { Client } = require('../../../'); describe('ClientLabelTest', function () { - let cluster; let client; @@ -50,5 +49,4 @@ describe('ClientLabelTest', function () { expect(res.result).to.not.be.null; expect(res.result.toString()).to.equal('testLabel'); }); - }); diff --git a/test/integration/backward_compatible/ClientReconnectAdvancedTest.js b/test/integration/backward_compatible/ClientReconnectAdvancedTest.js index 1a5f13014..b6ead5a7b 100644 --- a/test/integration/backward_compatible/ClientReconnectAdvancedTest.js +++ b/test/integration/backward_compatible/ClientReconnectAdvancedTest.js @@ -25,7 +25,6 @@ const TestUtil = require('../../TestUtil'); * Advanced tests for reconnection to cluster scenarios. */ describe('ClientReconnectAdvancedTest', function () { - let cluster; let client; @@ -95,7 +94,6 @@ describe('ClientReconnectAdvancedTest', function () { const member = members[0]; expect(member.uuid.toString()).to.be.equal(newMember.uuid); }); - } async function testListenersAfterClientDisconnected(memberAddress, clientAddress) { diff --git a/test/integration/backward_compatible/ClientReconnectTest.js b/test/integration/backward_compatible/ClientReconnectTest.js index 116e32cce..4e2e63696 100644 --- a/test/integration/backward_compatible/ClientReconnectTest.js +++ b/test/integration/backward_compatible/ClientReconnectTest.js @@ -24,7 +24,6 @@ const { markClientVersionAtLeast } = require('../../TestUtil'); * Basic tests for reconnection to cluster scenarios. */ describe('ClientReconnectTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/ClientRedoEnabledTest.js b/test/integration/backward_compatible/ClientRedoEnabledTest.js index 68cfa22e8..2f8eb0aba 100644 --- a/test/integration/backward_compatible/ClientRedoEnabledTest.js +++ b/test/integration/backward_compatible/ClientRedoEnabledTest.js @@ -27,7 +27,6 @@ const { } = require('../../../'); describe('ClientRedoEnabledTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/ClusterServiceTest.js b/test/integration/backward_compatible/ClusterServiceTest.js index 49d6b5e1e..6de1085ef 100644 --- a/test/integration/backward_compatible/ClusterServiceTest.js +++ b/test/integration/backward_compatible/ClusterServiceTest.js @@ -23,7 +23,6 @@ const RC = require('../RC'); const { Client } = require('../../../'); describe('ClusterServiceTest', function () { - let cluster; let member1; let client; diff --git a/test/integration/backward_compatible/ConnectionStrategyTest.js b/test/integration/backward_compatible/ConnectionStrategyTest.js index 787d43965..6fc74a275 100644 --- a/test/integration/backward_compatible/ConnectionStrategyTest.js +++ b/test/integration/backward_compatible/ConnectionStrategyTest.js @@ -32,7 +32,6 @@ const { LifecycleState } = require('../../../lib/LifecycleService'); const TestUtil = require('../../TestUtil'); describe('ConnectionStrategyTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/DistributedObjectsTest.js b/test/integration/backward_compatible/DistributedObjectsTest.js index 4313aff74..5c7eb3ab0 100644 --- a/test/integration/backward_compatible/DistributedObjectsTest.js +++ b/test/integration/backward_compatible/DistributedObjectsTest.js @@ -26,7 +26,6 @@ const { Client } = require('../../../'); const TestUtil = require('../../TestUtil'); describe('DistributedObjectsTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/HazelcastClientTest.js b/test/integration/backward_compatible/HazelcastClientTest.js index d9dc9cf58..338a0f339 100644 --- a/test/integration/backward_compatible/HazelcastClientTest.js +++ b/test/integration/backward_compatible/HazelcastClientTest.js @@ -22,7 +22,6 @@ const { deferredPromise } = require('../../../lib/util/Util'); const TestUtil = require('../../TestUtil'); class ManagedObjects { - constructor() { this.managedObjects = []; } @@ -53,7 +52,6 @@ class ManagedObjects { }); return deferred.promise; } - } const dummyConfig = { @@ -75,7 +73,6 @@ const configParams = [ configParams.forEach((cfg) => { describe('HazelcastClientTest[smart=' + cfg.network.smartRouting + ']', function () { - let cluster; let client; let managed; diff --git a/test/integration/backward_compatible/InitialMembershipListenerTest.js b/test/integration/backward_compatible/InitialMembershipListenerTest.js index 73e6d37fc..f7d62e1f4 100644 --- a/test/integration/backward_compatible/InitialMembershipListenerTest.js +++ b/test/integration/backward_compatible/InitialMembershipListenerTest.js @@ -26,7 +26,6 @@ const { Client } = require('../../../'); const { deferredPromise } = require('../../../lib/util/Util'); describe('InitialMembershipListenerTest', function () { - let cluster; let initialMember; let client; diff --git a/test/integration/backward_compatible/LifecycleServiceTest.js b/test/integration/backward_compatible/LifecycleServiceTest.js index f60848071..064f78217 100644 --- a/test/integration/backward_compatible/LifecycleServiceTest.js +++ b/test/integration/backward_compatible/LifecycleServiceTest.js @@ -20,7 +20,6 @@ const RC = require('../RC'); const { Client } = require('../../../'); describe('LifecycleServiceTest', function () { - let cluster; before(async function () { diff --git a/test/integration/backward_compatible/ListenerServiceTest.js b/test/integration/backward_compatible/ListenerServiceTest.js index 73b802f4d..13dc5c103 100644 --- a/test/integration/backward_compatible/ListenerServiceTest.js +++ b/test/integration/backward_compatible/ListenerServiceTest.js @@ -22,7 +22,6 @@ const TestUtil = require('../../TestUtil'); [true, false].forEach((isSmartService) => { describe('ListenerServiceTest[smart=' + isSmartService + ']', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/ListenersOnReconnectTest.js b/test/integration/backward_compatible/ListenersOnReconnectTest.js index 50a45235a..0efb58115 100644 --- a/test/integration/backward_compatible/ListenersOnReconnectTest.js +++ b/test/integration/backward_compatible/ListenersOnReconnectTest.js @@ -21,7 +21,6 @@ const { Client } = require('../../../'); const TestUtil = require('../../TestUtil'); describe('ListenersOnReconnectTest', function () { - let client; let cluster; let map; @@ -80,7 +79,6 @@ describe('ListenersOnReconnectTest', function () { } [true, false].forEach((isSmart) => { - /** * We use three members to simulate all configurations where connection is closed to; * - ownerconnection diff --git a/test/integration/backward_compatible/LoggingTest.js b/test/integration/backward_compatible/LoggingTest.js index 47422f169..2c84fbb9e 100644 --- a/test/integration/backward_compatible/LoggingTest.js +++ b/test/integration/backward_compatible/LoggingTest.js @@ -22,7 +22,6 @@ const RC = require('../RC'); const { Client, LogLevel } = require('../../../'); describe('LoggingTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/LostConnectionTest.js b/test/integration/backward_compatible/LostConnectionTest.js index 1136e39e5..c6b464ace 100644 --- a/test/integration/backward_compatible/LostConnectionTest.js +++ b/test/integration/backward_compatible/LostConnectionTest.js @@ -21,7 +21,6 @@ const { Client } = require('../../../'); const TestUtil = require('../../TestUtil'); describe('LostConnectionTest', function () { - let cluster; let oldMember; let client; diff --git a/test/integration/backward_compatible/MembershipListenerTest.js b/test/integration/backward_compatible/MembershipListenerTest.js index 436debe66..4c863a632 100644 --- a/test/integration/backward_compatible/MembershipListenerTest.js +++ b/test/integration/backward_compatible/MembershipListenerTest.js @@ -21,7 +21,6 @@ const { Client, MemberEvent } = require('../../../'); const { deferredPromise } = require('../../../lib/util/Util'); describe('MembershipListenerTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/cpsubsystem/AtomicLongTest.js b/test/integration/backward_compatible/cpsubsystem/AtomicLongTest.js index 2cffd259a..9a4324e00 100644 --- a/test/integration/backward_compatible/cpsubsystem/AtomicLongTest.js +++ b/test/integration/backward_compatible/cpsubsystem/AtomicLongTest.js @@ -30,7 +30,6 @@ const { const TestUtil = require('../../../TestUtil'); describe('AtomicLongTest', function () { - let cluster; let client; let long; diff --git a/test/integration/backward_compatible/cpsubsystem/AtomicReferenceTest.js b/test/integration/backward_compatible/cpsubsystem/AtomicReferenceTest.js index fff4339d3..0e9199e35 100644 --- a/test/integration/backward_compatible/cpsubsystem/AtomicReferenceTest.js +++ b/test/integration/backward_compatible/cpsubsystem/AtomicReferenceTest.js @@ -27,7 +27,6 @@ const { } = require('../../../../'); describe('AtomicReferenceTest', function () { - let cluster; let client; let ref; diff --git a/test/integration/backward_compatible/cpsubsystem/CountDownLatchTest.js b/test/integration/backward_compatible/cpsubsystem/CountDownLatchTest.js index b3485ef3b..3ac27c1e9 100644 --- a/test/integration/backward_compatible/cpsubsystem/CountDownLatchTest.js +++ b/test/integration/backward_compatible/cpsubsystem/CountDownLatchTest.js @@ -28,7 +28,6 @@ const { } = require('../../../../'); describe('CountDownLatchTest', function () { - let cluster; let client; let groupSeq = 0; diff --git a/test/integration/backward_compatible/cpsubsystem/FencedLockTest.js b/test/integration/backward_compatible/cpsubsystem/FencedLockTest.js index 9d0724c9e..18f9712f0 100644 --- a/test/integration/backward_compatible/cpsubsystem/FencedLockTest.js +++ b/test/integration/backward_compatible/cpsubsystem/FencedLockTest.js @@ -29,7 +29,6 @@ const { const TestUtil = require('../../../TestUtil'); describe('FencedLockTest', function () { - let cluster; let client; let lock; diff --git a/test/integration/backward_compatible/cpsubsystem/SemaphoreCommonTest.js b/test/integration/backward_compatible/cpsubsystem/SemaphoreCommonTest.js index c499a86cd..1ff26bde8 100644 --- a/test/integration/backward_compatible/cpsubsystem/SemaphoreCommonTest.js +++ b/test/integration/backward_compatible/cpsubsystem/SemaphoreCommonTest.js @@ -27,7 +27,6 @@ const { } = require('../../../../'); describe('SemaphoreCommonTest', function () { - let cluster; let client; const testTypes = ['sessionless', 'sessionaware']; @@ -78,7 +77,6 @@ describe('SemaphoreCommonTest', function () { for (const type of testTypes) { describe(`[${type}]`, function () { - it('availablePermits: should return available permits count', async function () { const semaphore = await getSemaphore(type, 3); const permits = await semaphore.availablePermits(); diff --git a/test/integration/backward_compatible/cpsubsystem/SessionAwareSemaphoreTest.js b/test/integration/backward_compatible/cpsubsystem/SessionAwareSemaphoreTest.js index c63d43780..875a5bf2f 100644 --- a/test/integration/backward_compatible/cpsubsystem/SessionAwareSemaphoreTest.js +++ b/test/integration/backward_compatible/cpsubsystem/SessionAwareSemaphoreTest.js @@ -27,7 +27,6 @@ const { } = require('../../../../'); describe('SessionAwareSemaphoreTest', function () { - let cluster; let client; let groupSeq = 0; diff --git a/test/integration/backward_compatible/cpsubsystem/SessionlessSemaphoreTest.js b/test/integration/backward_compatible/cpsubsystem/SessionlessSemaphoreTest.js index 68baca2b2..661d30e00 100644 --- a/test/integration/backward_compatible/cpsubsystem/SessionlessSemaphoreTest.js +++ b/test/integration/backward_compatible/cpsubsystem/SessionlessSemaphoreTest.js @@ -24,7 +24,6 @@ const RC = require('../../RC'); const { Client } = require('../../../../'); describe('SessionlessSemaphoreTest', function () { - let cluster; let client; let groupSeq = 0; diff --git a/test/integration/backward_compatible/flakeid/FlakeIdGeneratorOutOfRangeTest.js b/test/integration/backward_compatible/flakeid/FlakeIdGeneratorOutOfRangeTest.js index c8058d2d6..6680a8238 100644 --- a/test/integration/backward_compatible/flakeid/FlakeIdGeneratorOutOfRangeTest.js +++ b/test/integration/backward_compatible/flakeid/FlakeIdGeneratorOutOfRangeTest.js @@ -24,7 +24,6 @@ const { Client, HazelcastError } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('FlakeIdGeneratorOutOfRangeTest', function () { - let cluster, client; let flakeIdGenerator; diff --git a/test/integration/backward_compatible/flakeid/FlakeIdGeneratorProxyTest.js b/test/integration/backward_compatible/flakeid/FlakeIdGeneratorProxyTest.js index 50ed99062..5e29e127a 100644 --- a/test/integration/backward_compatible/flakeid/FlakeIdGeneratorProxyTest.js +++ b/test/integration/backward_compatible/flakeid/FlakeIdGeneratorProxyTest.js @@ -23,7 +23,6 @@ const { Client } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('FlakeIdGeneratorProxyTest', function () { - const FLAKE_ID_STEP = 1 << 16; const SHORT_TERM_BATCH_SIZE = 3; const SHORT_TERM_VALIDITY_MILLIS = 3000; diff --git a/test/integration/backward_compatible/hazelcast_json_value/HJVHazelcastJsonValueSerializerTest.js b/test/integration/backward_compatible/hazelcast_json_value/HJVHazelcastJsonValueSerializerTest.js index dd5b017eb..861d9b852 100644 --- a/test/integration/backward_compatible/hazelcast_json_value/HJVHazelcastJsonValueSerializerTest.js +++ b/test/integration/backward_compatible/hazelcast_json_value/HJVHazelcastJsonValueSerializerTest.js @@ -24,7 +24,6 @@ const { } = require('../../../../'); describe('HazelcastJsonValue with HazelcastJsonValueSerializer', function () { - let cluster, client; let map; const object = { 'a': 1 }; diff --git a/test/integration/backward_compatible/hazelcast_json_value/HJVJsonSerializerTest.js b/test/integration/backward_compatible/hazelcast_json_value/HJVJsonSerializerTest.js index 80ead329e..a45c9b235 100644 --- a/test/integration/backward_compatible/hazelcast_json_value/HJVJsonSerializerTest.js +++ b/test/integration/backward_compatible/hazelcast_json_value/HJVJsonSerializerTest.js @@ -26,7 +26,6 @@ const { } = require('../../../../'); describe('HazelcastJsonValue with JsonSerializer', function () { - let cluster, client; let map; const object = { 'a': 1 }; diff --git a/test/integration/backward_compatible/hazelcast_json_value/HazelcastJsonValueQueryTest.js b/test/integration/backward_compatible/hazelcast_json_value/HazelcastJsonValueQueryTest.js index f3f7242ec..d14d8fc5b 100644 --- a/test/integration/backward_compatible/hazelcast_json_value/HazelcastJsonValueQueryTest.js +++ b/test/integration/backward_compatible/hazelcast_json_value/HazelcastJsonValueQueryTest.js @@ -27,7 +27,6 @@ const { } = require('../../../../'); describe('HazelcastJsonValue query test', function () { - let cluster, client; let map; const object = { 'a': 1 }; diff --git a/test/integration/backward_compatible/list/ListProxyTest.js b/test/integration/backward_compatible/list/ListProxyTest.js index 872cc8094..dd09a6be0 100644 --- a/test/integration/backward_compatible/list/ListProxyTest.js +++ b/test/integration/backward_compatible/list/ListProxyTest.js @@ -22,7 +22,6 @@ const { ItemEventType } = require('../../../../lib/proxy/ItemListener'); const { deferredPromise } = require('../../../../lib/util/Util'); describe('ListProxyTest', function () { - let cluster; let client; let list; diff --git a/test/integration/backward_compatible/map/MapAggregatorsDoubleTest.js b/test/integration/backward_compatible/map/MapAggregatorsDoubleTest.js index 71177acd6..57c5dbd89 100644 --- a/test/integration/backward_compatible/map/MapAggregatorsDoubleTest.js +++ b/test/integration/backward_compatible/map/MapAggregatorsDoubleTest.js @@ -25,7 +25,6 @@ const { const TestUtil = require('../../../TestUtil'); describe('MapAggregatorsDoubleTest', function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/map/MapAggregatorsIntTest.js b/test/integration/backward_compatible/map/MapAggregatorsIntTest.js index b6431d607..896a87ca5 100644 --- a/test/integration/backward_compatible/map/MapAggregatorsIntTest.js +++ b/test/integration/backward_compatible/map/MapAggregatorsIntTest.js @@ -25,7 +25,6 @@ const { const TestUtil = require('../../../TestUtil'); describe('MapAggregatorsIntTest', function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/map/MapAggregatorsLongTest.js b/test/integration/backward_compatible/map/MapAggregatorsLongTest.js index 2ba844039..ba635d0d1 100644 --- a/test/integration/backward_compatible/map/MapAggregatorsLongTest.js +++ b/test/integration/backward_compatible/map/MapAggregatorsLongTest.js @@ -25,7 +25,6 @@ const { } = require('../../../../'); describe('MapAggregatorsLongTest', function () { - const ENTRY_COUNT = 50; let cluster; diff --git a/test/integration/backward_compatible/map/MapEntryProcessorTest.js b/test/integration/backward_compatible/map/MapEntryProcessorTest.js index 2041b59df..f941c1fe2 100644 --- a/test/integration/backward_compatible/map/MapEntryProcessorTest.js +++ b/test/integration/backward_compatible/map/MapEntryProcessorTest.js @@ -28,7 +28,6 @@ const identifiedFactory = require('../../javaclasses/IdentifiedFactory'); const IdentifiedEntryProcessor = require('../../javaclasses/IdentifiedEntryProcessor'); describe('EntryProcessorTest', function () { - const MAP_SIZE = 1000; let cluster; diff --git a/test/integration/backward_compatible/map/MapLockTest.js b/test/integration/backward_compatible/map/MapLockTest.js index 1a40eef08..fbbddba3a 100644 --- a/test/integration/backward_compatible/map/MapLockTest.js +++ b/test/integration/backward_compatible/map/MapLockTest.js @@ -26,7 +26,6 @@ const TestUtil = require('../../../TestUtil'); * like member restart. */ describe('MapLockTest', function () { - const INVOCATION_TIMEOUT_FOR_TWO = 1000; function generateKeyOwnedBy(client, member) { diff --git a/test/integration/backward_compatible/map/MapPartitionAwareTest.js b/test/integration/backward_compatible/map/MapPartitionAwareTest.js index aaf196db6..ddb02f718 100644 --- a/test/integration/backward_compatible/map/MapPartitionAwareTest.js +++ b/test/integration/backward_compatible/map/MapPartitionAwareTest.js @@ -20,7 +20,6 @@ const RC = require('../../RC'); const { Client } = require('../../../../'); describe('MapPartitionAwareTest', function () { - const numOfEntries = 10000; const memberCount = 3; const mapName = 'testMap'; diff --git a/test/integration/backward_compatible/map/MapPredicateTest.js b/test/integration/backward_compatible/map/MapPredicateTest.js index 831421f2b..db265914d 100644 --- a/test/integration/backward_compatible/map/MapPredicateTest.js +++ b/test/integration/backward_compatible/map/MapPredicateTest.js @@ -27,7 +27,6 @@ const identifiedFactory = require('../../javaclasses/IdentifiedFactory'); const CustomComparator = require('../../javaclasses/CustomComparator'); describe('MapPredicateTest', function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/map/MapProxyTest.js b/test/integration/backward_compatible/map/MapProxyTest.js index 2f74a7859..a407501ea 100644 --- a/test/integration/backward_compatible/map/MapProxyTest.js +++ b/test/integration/backward_compatible/map/MapProxyTest.js @@ -45,7 +45,6 @@ async function createClient(nearCacheEnabled, clusterName) { describe('MapProxyTest', function () { [false, true].forEach((nearCacheEnabled) => { describe(' - Near Cache enabled: ' + nearCacheEnabled, function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/map/MapStoreTest.js b/test/integration/backward_compatible/map/MapStoreTest.js index e7f12ada1..6371c148f 100644 --- a/test/integration/backward_compatible/map/MapStoreTest.js +++ b/test/integration/backward_compatible/map/MapStoreTest.js @@ -22,7 +22,6 @@ const { Client } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('MapStoreTest', function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/map/NearCachedMapStressTest.js b/test/integration/backward_compatible/map/NearCachedMapStressTest.js index 50008f26c..3a57f3355 100644 --- a/test/integration/backward_compatible/map/NearCachedMapStressTest.js +++ b/test/integration/backward_compatible/map/NearCachedMapStressTest.js @@ -24,7 +24,6 @@ const { deferredPromise } = require('../../../../lib/util/Util'); const TestUtil = require('../../../TestUtil'); describe('NearCachedMapStress', function () { - const NUMBER_OF_ENTRIES = 1000; const MAP_NAME = 'stressncmap'; const CONCURRENCY_LEVEL = 32; diff --git a/test/integration/backward_compatible/map/NearCachedMapTest.js b/test/integration/backward_compatible/map/NearCachedMapTest.js index d40d49298..084146441 100644 --- a/test/integration/backward_compatible/map/NearCachedMapTest.js +++ b/test/integration/backward_compatible/map/NearCachedMapTest.js @@ -22,10 +22,8 @@ const { Client } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('NearCachedMapTest', function () { - [true, false].forEach((invalidateOnChange) => { describe('invalidate on change=' + invalidateOnChange, function () { - let cluster; let client1; let client2; diff --git a/test/integration/backward_compatible/multimap/MultiMapProxyListenersTest.js b/test/integration/backward_compatible/multimap/MultiMapProxyListenersTest.js index 42ac3180b..acf97fdc5 100644 --- a/test/integration/backward_compatible/multimap/MultiMapProxyListenersTest.js +++ b/test/integration/backward_compatible/multimap/MultiMapProxyListenersTest.js @@ -22,7 +22,6 @@ const { Client } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('MultiMap Proxy Listener', function () { - let cluster; let client; let map; @@ -53,7 +52,6 @@ describe('MultiMap Proxy Listener', function () { expectedValue, expectedOldValue, expectedMergingValue) { - this[eventName] = function (entryEvent) { try { expect(entryEvent.name).to.equal(expectedName); diff --git a/test/integration/backward_compatible/multimap/MultiMapProxyLockTest.js b/test/integration/backward_compatible/multimap/MultiMapProxyLockTest.js index e0be7e107..ead1b9eff 100644 --- a/test/integration/backward_compatible/multimap/MultiMapProxyLockTest.js +++ b/test/integration/backward_compatible/multimap/MultiMapProxyLockTest.js @@ -20,7 +20,6 @@ const RC = require('../../RC'); const Client = require('../../../..').Client; describe('MultiMapProxyLockTest', function () { - let cluster; let clientOne; let clientTwo; diff --git a/test/integration/backward_compatible/multimap/MultiMapProxyTest.js b/test/integration/backward_compatible/multimap/MultiMapProxyTest.js index eaf5ee64c..27ab52fe2 100644 --- a/test/integration/backward_compatible/multimap/MultiMapProxyTest.js +++ b/test/integration/backward_compatible/multimap/MultiMapProxyTest.js @@ -21,7 +21,6 @@ const { Client } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('MultiMapProxyTest', function () { - let cluster; let client; let map; @@ -207,6 +206,5 @@ describe('MultiMapProxyTest', function () { checkValues([2, 22], values.toArray()); values = await map.get('c'); checkValues([3, 33, 333], values.toArray()); - }); }); diff --git a/test/integration/backward_compatible/nearcache/InvalidationMetadataDistortionTest.js b/test/integration/backward_compatible/nearcache/InvalidationMetadataDistortionTest.js index 002791f28..5ba80b893 100644 --- a/test/integration/backward_compatible/nearcache/InvalidationMetadataDistortionTest.js +++ b/test/integration/backward_compatible/nearcache/InvalidationMetadataDistortionTest.js @@ -24,7 +24,6 @@ const identifiedFactory = require('../../javaclasses/IdentifiedFactory'); const DistortInvalidationMetadataEntryProcessor = require('../../javaclasses/DistortInvalidationMetadataEntryProcessor'); describe('Invalidation metadata distortion', function () { - const mapName = 'nc-map'; const mapSize = 10; diff --git a/test/integration/backward_compatible/nearcache/MigratedDataTest.js b/test/integration/backward_compatible/nearcache/MigratedDataTest.js index 77c7f5b96..a36347d44 100644 --- a/test/integration/backward_compatible/nearcache/MigratedDataTest.js +++ b/test/integration/backward_compatible/nearcache/MigratedDataTest.js @@ -23,7 +23,6 @@ const { deferredPromise } = require('../../../../lib/util/Util'); const TestUtil = require('../../../TestUtil'); describe('MigratedDataTest', function () { - const mapName = 'ncmap'; let cluster; diff --git a/test/integration/backward_compatible/nearcache/NearCacheSimpleInvalidationTest.js b/test/integration/backward_compatible/nearcache/NearCacheSimpleInvalidationTest.js index 4ae0cbce6..6732af087 100644 --- a/test/integration/backward_compatible/nearcache/NearCacheSimpleInvalidationTest.js +++ b/test/integration/backward_compatible/nearcache/NearCacheSimpleInvalidationTest.js @@ -25,7 +25,6 @@ const RC = require('../../RC'); const { Client } = require('../../../../'); describe('NearCacheSimpleInvalidationTest', function () { - const mapName = 'nccmap'; let cluster; diff --git a/test/integration/backward_compatible/nearcache/NonStopNearCache.js b/test/integration/backward_compatible/nearcache/NonStopNearCache.js index 1448e74ba..7b93286ff 100644 --- a/test/integration/backward_compatible/nearcache/NonStopNearCache.js +++ b/test/integration/backward_compatible/nearcache/NonStopNearCache.js @@ -24,7 +24,6 @@ const { Client, LifecycleState, ClientOfflineError } = require('../../../../'); const { deferredPromise } = require('../../../../lib/util/Util'); describe('NonStopNearCacheTest', function () { - let map; let cluster; let client; @@ -97,5 +96,4 @@ describe('NonStopNearCacheTest', function () { done(); }).catch(done); }); - }); diff --git a/test/integration/backward_compatible/pncounter/PNCounterBasicTest.js b/test/integration/backward_compatible/pncounter/PNCounterBasicTest.js index e4459490a..1dccc4684 100644 --- a/test/integration/backward_compatible/pncounter/PNCounterBasicTest.js +++ b/test/integration/backward_compatible/pncounter/PNCounterBasicTest.js @@ -20,7 +20,6 @@ const RC = require('../../RC'); const { Client } = require('../../../../'); describe('PNCounterBasicTest', function () { - let cluster; let client; let pnCounter; diff --git a/test/integration/backward_compatible/pncounter/PNCounterConsistencyTest.js b/test/integration/backward_compatible/pncounter/PNCounterConsistencyTest.js index 482c16331..959c75d07 100644 --- a/test/integration/backward_compatible/pncounter/PNCounterConsistencyTest.js +++ b/test/integration/backward_compatible/pncounter/PNCounterConsistencyTest.js @@ -25,7 +25,6 @@ const RC = require('../../RC'); const { Client, ConsistencyLostError } = require('../../../../'); describe('PNCounterConsistencyTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/pncounter/PNCounterWithLiteMembersTest.js b/test/integration/backward_compatible/pncounter/PNCounterWithLiteMembersTest.js index 4c4eb1af0..92ee65923 100644 --- a/test/integration/backward_compatible/pncounter/PNCounterWithLiteMembersTest.js +++ b/test/integration/backward_compatible/pncounter/PNCounterWithLiteMembersTest.js @@ -25,7 +25,6 @@ const RC = require('../../RC'); const { Client, NoDataMemberInClusterError } = require('../../../../'); describe('PNCounterWithLiteMembersTest', function () { - let cluster; let client; let pncounter; diff --git a/test/integration/backward_compatible/queue/QueueProxyTest.js b/test/integration/backward_compatible/queue/QueueProxyTest.js index 3448e8954..bbefc43f6 100644 --- a/test/integration/backward_compatible/queue/QueueProxyTest.js +++ b/test/integration/backward_compatible/queue/QueueProxyTest.js @@ -26,7 +26,6 @@ const { Client } = require('../../../../'); const { ItemEventType } = require('../../../../lib/proxy/ItemListener'); describe('QueueProxyTest', function () { - let cluster; let client; let queue; diff --git a/test/integration/backward_compatible/replicatedmap/ReplicatedMapProxyTest.js b/test/integration/backward_compatible/replicatedmap/ReplicatedMapProxyTest.js index 7266955a4..01b82d785 100644 --- a/test/integration/backward_compatible/replicatedmap/ReplicatedMapProxyTest.js +++ b/test/integration/backward_compatible/replicatedmap/ReplicatedMapProxyTest.js @@ -23,7 +23,6 @@ const { Client, Predicates } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('ReplicatedMapProxyTest', function () { - const ONE_HOUR = 3600000; let cluster; @@ -377,7 +376,6 @@ describe('ReplicatedMapProxyTest', function () { .then(() => { done(error); }); - } }; rm.addEntryListenerWithPredicate(listener, Predicates.sql('this == val10')) @@ -399,7 +397,6 @@ describe('ReplicatedMapProxyTest', function () { expect(entryEvent.oldValue).to.be.equal(null); expect(entryEvent.mergingValue).to.be.equal(null); expect(entryEvent.member).to.not.be.equal(null); - } catch (err) { error = err; } diff --git a/test/integration/backward_compatible/rest_value/RestValueTest.js b/test/integration/backward_compatible/rest_value/RestValueTest.js index e67065db2..7fd38af0e 100644 --- a/test/integration/backward_compatible/rest_value/RestValueTest.js +++ b/test/integration/backward_compatible/rest_value/RestValueTest.js @@ -26,7 +26,6 @@ const { Client } = require('../../../../'); const { deferredPromise } = require('../../../../lib/util/Util'); describe('RestValueTest', function () { - let cluster; let client; let member; diff --git a/test/integration/backward_compatible/ringbuffer/RingbufferProxyTest.js b/test/integration/backward_compatible/ringbuffer/RingbufferProxyTest.js index 30fe5895e..f9a78c638 100644 --- a/test/integration/backward_compatible/ringbuffer/RingbufferProxyTest.js +++ b/test/integration/backward_compatible/ringbuffer/RingbufferProxyTest.js @@ -22,7 +22,6 @@ const { Client, StaleSequenceError } = require('../../../../'); const PrefixFilter = require('../../javaclasses/PrefixFilter'); describe('RingbufferProxyTest', function () { - let cluster; let client; let rb; diff --git a/test/integration/backward_compatible/serialization/CustomSerializerConfigTest.js b/test/integration/backward_compatible/serialization/CustomSerializerConfigTest.js index 50aa432d5..0970cca31 100644 --- a/test/integration/backward_compatible/serialization/CustomSerializerConfigTest.js +++ b/test/integration/backward_compatible/serialization/CustomSerializerConfigTest.js @@ -21,7 +21,6 @@ const { Client } = require('../../../../'); const { Musician, MusicianSerializer } = require('./Musician'); describe('CustomSerializerConfigTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/serialization/DefaultSerializersLiveTest.js b/test/integration/backward_compatible/serialization/DefaultSerializersLiveTest.js index d49419af1..1ce07ce18 100644 --- a/test/integration/backward_compatible/serialization/DefaultSerializersLiveTest.js +++ b/test/integration/backward_compatible/serialization/DefaultSerializersLiveTest.js @@ -23,7 +23,6 @@ const { Client, RestValue, UUID } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('DefaultSerializersLiveTest', function () { - let cluster, client; let map; diff --git a/test/integration/backward_compatible/serialization/FactoriesTest.js b/test/integration/backward_compatible/serialization/FactoriesTest.js index 451104dea..0fb34ae5b 100644 --- a/test/integration/backward_compatible/serialization/FactoriesTest.js +++ b/test/integration/backward_compatible/serialization/FactoriesTest.js @@ -22,7 +22,6 @@ const { myPortableFactory, Foo } = require('./Foo'); const { myIdentifiedFactory, Address } = require('./Address'); describe('FactoriesTest', function () { - let cluster; let client; diff --git a/test/integration/backward_compatible/serialization/PortableSerializersLiveTest.js b/test/integration/backward_compatible/serialization/PortableSerializersLiveTest.js index fe099823d..fd58eeceb 100644 --- a/test/integration/backward_compatible/serialization/PortableSerializersLiveTest.js +++ b/test/integration/backward_compatible/serialization/PortableSerializersLiveTest.js @@ -22,7 +22,6 @@ const { Client } = require('../../../../'); const { SimplePortable, InnerPortable } = require('../../../unit/serialization/PortableObjects'); describe('PortableSerializersLiveTest', function () { - let cluster; let client; let map; diff --git a/test/integration/backward_compatible/set/SetProxyTest.js b/test/integration/backward_compatible/set/SetProxyTest.js index b4190151d..07f704875 100644 --- a/test/integration/backward_compatible/set/SetProxyTest.js +++ b/test/integration/backward_compatible/set/SetProxyTest.js @@ -21,7 +21,6 @@ const { Client } = require('../../../../'); const { ItemEventType } = require('../../../../lib/proxy/ItemListener'); describe('SetProxyTest', function () { - let cluster; let client; let setInstance; diff --git a/test/integration/backward_compatible/sql/DataTypeTest.js b/test/integration/backward_compatible/sql/DataTypeTest.js index f6c5baa2f..cb9ad7d08 100644 --- a/test/integration/backward_compatible/sql/DataTypeTest.js +++ b/test/integration/backward_compatible/sql/DataTypeTest.js @@ -716,7 +716,6 @@ describe('Data type test', function () { datetimeWithOffset.localDateTime.localTime.second.should.be.eq(expectedBaseValues.second + i); datetimeWithOffset.localDateTime.localTime.nano.should.be.eq(expectedBaseValues.nano + i); } else { - datetimeWithOffset.should.be.a('string'); datetimeWithOffset.should.be.eq(`${leftZeroPadInteger(expectedBaseValues.year + i, 4)}-` + `${leftZeroPadInteger(expectedBaseValues.month + i, 2)}-` diff --git a/test/integration/backward_compatible/sql/ExecuteTest.js b/test/integration/backward_compatible/sql/ExecuteTest.js index 3bcc8923e..76882a824 100644 --- a/test/integration/backward_compatible/sql/ExecuteTest.js +++ b/test/integration/backward_compatible/sql/ExecuteTest.js @@ -268,7 +268,6 @@ describe('SqlExecuteTest', function () { }); }); describe('mixed cluster of lite and data members', function () { - before(async function () { cluster = await RC.createCluster(null, LITE_MEMBER_CONFIG); await RC.startMember(cluster.id); diff --git a/test/integration/backward_compatible/sql/RowTest.js b/test/integration/backward_compatible/sql/RowTest.js index 6fec44a58..c6b0d6a7e 100644 --- a/test/integration/backward_compatible/sql/RowTest.js +++ b/test/integration/backward_compatible/sql/RowTest.js @@ -94,5 +94,4 @@ describe('SqlRowTest', function () { row.getMetadata().should.be.eq(rowMetadata); } }); - }); diff --git a/test/integration/backward_compatible/ssl/ClientSSLAuthenticationTest.js b/test/integration/backward_compatible/ssl/ClientSSLAuthenticationTest.js index e02b15fae..8c0b4eefa 100644 --- a/test/integration/backward_compatible/ssl/ClientSSLAuthenticationTest.js +++ b/test/integration/backward_compatible/ssl/ClientSSLAuthenticationTest.js @@ -27,7 +27,6 @@ const { Client, IllegalStateError } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('ClientSSLAuthenticationTest', function () { - let cluster; const maRequiredXML = __dirname + '/hazelcast-ma-required.xml'; @@ -103,7 +102,6 @@ describe('ClientSSLAuthenticationTest', function () { } describe(title, function () { - afterEach(async function () { await RC.terminateCluster(cluster.id); }); diff --git a/test/integration/backward_compatible/ssl/ClientSSLTest.js b/test/integration/backward_compatible/ssl/ClientSSLTest.js index a3ee71578..2cb74cce1 100644 --- a/test/integration/backward_compatible/ssl/ClientSSLTest.js +++ b/test/integration/backward_compatible/ssl/ClientSSLTest.js @@ -25,7 +25,6 @@ const { Client, IllegalStateError } = require('../../../../'); const TestUtil = require('../../../TestUtil'); describe('ClientSSLTest', function () { - let cluster; let client; let serverConfig; diff --git a/test/integration/backward_compatible/statistics/StatisticsTest.js b/test/integration/backward_compatible/statistics/StatisticsTest.js index 64b0edf52..b428cda10 100644 --- a/test/integration/backward_compatible/statistics/StatisticsTest.js +++ b/test/integration/backward_compatible/statistics/StatisticsTest.js @@ -61,7 +61,6 @@ function extractIntStatValue(stats, statName) { } describe('StatisticsTest (default period)', function () { - let cluster; let client; let map; @@ -145,7 +144,6 @@ describe('StatisticsTest (default period)', function () { }); describe('StatisticsTest (non-default period)', function () { - let cluster; let client; @@ -183,7 +181,6 @@ describe('StatisticsTest (non-default period)', function () { }); describe('StatisticsTest (negative period)', function () { - let client; let cluster; diff --git a/test/integration/backward_compatible/topic/ReliableTopicOnClusterRestart.js b/test/integration/backward_compatible/topic/ReliableTopicOnClusterRestart.js index 9b7b1cf18..3b7ca4240 100644 --- a/test/integration/backward_compatible/topic/ReliableTopicOnClusterRestart.js +++ b/test/integration/backward_compatible/topic/ReliableTopicOnClusterRestart.js @@ -24,7 +24,6 @@ const { Client } = require('../../../../'); const { promiseWaitMilliseconds, assertTrueEventually, randomString, markClientVersionAtLeast } = require('../../../TestUtil'); describe('ReliableTopicOnClusterRestartTest', function () { - let cluster; let member; let client1; diff --git a/test/integration/backward_compatible/topic/ReliableTopicTest.js b/test/integration/backward_compatible/topic/ReliableTopicTest.js index 99d17bc92..1bc77936c 100644 --- a/test/integration/backward_compatible/topic/ReliableTopicTest.js +++ b/test/integration/backward_compatible/topic/ReliableTopicTest.js @@ -24,7 +24,6 @@ const { Client, TopicOverloadPolicy } = require('../../../../'); const { ReliableTopicMessage } = require('../../../../lib/proxy/topic/ReliableTopicMessage'); describe('ReliableTopicTest', function () { - let cluster; let clientOne; let clientTwo; diff --git a/test/integration/heartbeat/HeartbeatFromClientTest.js b/test/integration/heartbeat/HeartbeatFromClientTest.js index f082f83af..194f4078d 100644 --- a/test/integration/heartbeat/HeartbeatFromClientTest.js +++ b/test/integration/heartbeat/HeartbeatFromClientTest.js @@ -22,7 +22,6 @@ const { Client } = require('../../../'); const TestUtil = require('../../TestUtil'); describe('HeartbeatFromClientTest', function () { - let cluster; beforeEach(async function () { diff --git a/test/integration/heartbeat/HeartbeatFromServerTest.js b/test/integration/heartbeat/HeartbeatFromServerTest.js index 21383fac1..d7fdf0a17 100644 --- a/test/integration/heartbeat/HeartbeatFromServerTest.js +++ b/test/integration/heartbeat/HeartbeatFromServerTest.js @@ -25,7 +25,6 @@ const { deferredPromise } = require('../../../lib/util/Util'); const TestUtil = require('../../TestUtil'); describe('HeartbeatFromServerTest', function () { - let cluster; let client; diff --git a/test/integration/nearcache/LostInvalidationsTest.js b/test/integration/nearcache/LostInvalidationsTest.js index 2186fe98f..4ab19672e 100644 --- a/test/integration/nearcache/LostInvalidationsTest.js +++ b/test/integration/nearcache/LostInvalidationsTest.js @@ -23,7 +23,6 @@ const { deferredPromise } = require('../../../lib/util/Util'); const TestUtil = require('../../TestUtil'); describe('LostInvalidationTest', function () { - const entryCount = 1000; const mapName = 'ncmap'; diff --git a/test/integration/nearcache/RepairingTaskTest.js b/test/integration/nearcache/RepairingTaskTest.js index be5651ab6..126e8cf1f 100644 --- a/test/integration/nearcache/RepairingTaskTest.js +++ b/test/integration/nearcache/RepairingTaskTest.js @@ -20,7 +20,6 @@ const RC = require('../RC'); const { Client } = require('../../../'); describe('RepairingTask', function () { - let cluster; let client; diff --git a/test/unit/ClientProxyTest.js b/test/unit/ClientProxyTest.js index eb9e56dfd..d99f07230 100644 --- a/test/unit/ClientProxyTest.js +++ b/test/unit/ClientProxyTest.js @@ -26,7 +26,6 @@ const { Connection } = require('../../lib/network/Connection'); const { ProxyManager } = require('../../lib/proxy/ProxyManager'); describe('ClientProxyTest', function () { - afterEach(async function () { sandbox.restore(); }); diff --git a/test/unit/ClusterFailoverServiceBuilderTest.js b/test/unit/ClusterFailoverServiceBuilderTest.js index 6818209fb..ef77c5f09 100644 --- a/test/unit/ClusterFailoverServiceBuilderTest.js +++ b/test/unit/ClusterFailoverServiceBuilderTest.js @@ -30,7 +30,6 @@ const { HazelcastCloudAddressProvider } = require('../../lib/discovery/Hazelcast const { IllegalStateError } = require('../../'); describe('ClusterFailoverServiceBuilderTest', function () { - let lifecycleServiceStub; let loggingServiceStub; diff --git a/test/unit/ClusterFailoverServiceTest.js b/test/unit/ClusterFailoverServiceTest.js index 6392de30a..ebf5ee376 100644 --- a/test/unit/ClusterFailoverServiceTest.js +++ b/test/unit/ClusterFailoverServiceTest.js @@ -28,7 +28,6 @@ const { const { LifecycleServiceImpl } = require('../../lib/LifecycleService'); describe('ClusterFailoverServiceTest', function () { - let lifecycleServiceStub; function clusterContext(clusterName) { diff --git a/test/unit/RepetitionTaskTest.js b/test/unit/RepetitionTaskTest.js index 82c5fd08a..20ddedaca 100644 --- a/test/unit/RepetitionTaskTest.js +++ b/test/unit/RepetitionTaskTest.js @@ -20,7 +20,6 @@ const Util = require('../../lib/util/Util'); const TestUtil = require('../TestUtil'); describe('RepetitionTaskTest', function () { - it('should be cancelled before timeout', async function () { let counter = 0; const task = Util.scheduleWithRepetition(() => counter++, 50, 100); diff --git a/test/unit/codec/builtin/FixSizedTypesCodecTest.js b/test/unit/codec/builtin/FixSizedTypesCodecTest.js index 322cc9dd5..a74ff0cc3 100644 --- a/test/unit/codec/builtin/FixSizedTypesCodecTest.js +++ b/test/unit/codec/builtin/FixSizedTypesCodecTest.js @@ -19,7 +19,6 @@ const { expect } = require('chai'); const { FixSizedTypesCodec } = require('../../../../lib/codec/builtin/FixSizedTypesCodec'); describe('FixSizedTypesCodecTest', function () { - const TWO_PWR_63_DBL = 9223372036854776000; it('should throw error when trying to encode negative number as long', function () { diff --git a/test/unit/config/ConfigBuilderHazelcastCloudTest.js b/test/unit/config/ConfigBuilderHazelcastCloudTest.js index 889d52160..3029f5f1c 100644 --- a/test/unit/config/ConfigBuilderHazelcastCloudTest.js +++ b/test/unit/config/ConfigBuilderHazelcastCloudTest.js @@ -24,7 +24,6 @@ const { ClientConfigImpl } = require('../../../lib/config/Config'); const { ConfigBuilder } = require('../../../lib/config/ConfigBuilder'); describe('ConfigBuilderHazelcastCloudTest', function () { - function loadJson(jsonPath) { const config = require(path.join(__dirname, jsonPath)); return new ConfigBuilder(config).build(); diff --git a/test/unit/config/ConfigBuilderSSLTest.js b/test/unit/config/ConfigBuilderSSLTest.js index 27f0e1943..a1fb33ec4 100644 --- a/test/unit/config/ConfigBuilderSSLTest.js +++ b/test/unit/config/ConfigBuilderSSLTest.js @@ -24,7 +24,6 @@ const { HazelcastError } = require('../../../'); const { ConfigBuilder } = require('../../../lib/config/ConfigBuilder'); describe('ConfigBuilderSSLTest', function () { - function loadJson(jsonPath) { const config = require(path.join(__dirname, jsonPath)); return new ConfigBuilder(config).build(); diff --git a/test/unit/config/ConfigBuilderTest.js b/test/unit/config/ConfigBuilderTest.js index e5a2c9c2c..4df1208ff 100644 --- a/test/unit/config/ConfigBuilderTest.js +++ b/test/unit/config/ConfigBuilderTest.js @@ -35,7 +35,6 @@ const { ReconnectMode } = require('../../../lib/config/ConnectionStrategyConfig' const { LogLevel } = require('../../../lib/logging/ILogger'); describe('ConfigBuilderTest', function () { - let fullConfig; const lifecycleListener = () => {}; const membershipListener = { @@ -268,6 +267,7 @@ describe('ConfigBuilderValidationTest', function () { }).build()).not.to.throw(); } }); + it('should validate max backoff', function () { const invalidValues = [-1, undefined, null, -0.1, [], {}]; const validValues = [0.1, 1, 12, 123123, 12.2131]; @@ -290,6 +290,7 @@ describe('ConfigBuilderValidationTest', function () { }).build()).not.to.throw(); } }); + it('should validate multiplier', function () { const invalidValues = [-1, undefined, null, -0.1, [], {}, 0.99, 0.21]; const validValues = [1, 12, 123123, 12.2131]; @@ -312,6 +313,7 @@ describe('ConfigBuilderValidationTest', function () { }).build()).not.to.throw(); } }); + it('should validate cluster connect timeout', function () { const invalidValues = [-2, undefined, null, -0.1, [], {}, -13]; const validValues = [-1, 0.1, 1, 12, 123123, 12.2131, 0]; @@ -334,6 +336,7 @@ describe('ConfigBuilderValidationTest', function () { }).build()).not.to.throw(); } }); + it('should validate jitter', function () { const invalidValues = [-1, undefined, null, -0.1, [], {}, 1.01, 123]; const validValues = [0.1, 0, 0.3, 0.99, 1]; @@ -358,6 +361,82 @@ describe('ConfigBuilderValidationTest', function () { }); }); + describe('properties', function () { + const propsAcceptingNumber = [ + 'hazelcast.client.heartbeat.interval', + 'hazelcast.client.heartbeat.timeout', + 'hazelcast.client.invocation.retry.pause.millis', + 'hazelcast.client.invocation.timeout.millis', + 'hazelcast.client.internal.clean.resources.millis', + 'hazelcast.client.statistics.period.seconds', + 'hazelcast.invalidation.reconciliation.interval.seconds', + 'hazelcast.invalidation.max.tolerated.miss.count', + 'hazelcast.invalidation.min.reconciliation.interval.seconds', + 'hazelcast.client.autopipelining.threshold.bytes', + 'hazelcast.client.operation.backup.timeout.millis', + ]; + + const propsAcceptingBoolean = [ + 'hazelcast.client.statistics.enabled', + 'hazelcast.client.autopipelining.enabled', + 'hazelcast.client.socket.no.delay', + 'hazelcast.client.shuffle.member.list', + 'hazelcast.client.operation.fail.on.indeterminate.state', + ]; + + const params = [ + ...propsAcceptingNumber.map(p => { + return { + property: p, + validValues: [1, 2, 22.2, 122323123, Number.MAX_SAFE_INTEGER], + invalidValues: [null, undefined, '1', '2', [], {}] + }; + }), + ...propsAcceptingBoolean.map(p => { + return { + property: p, + validValues: [true, false], + invalidValues: [1, 1.11, null, undefined, '1', '2', [], {}] + }; + }), + { + property: 'hazelcast.client.cloud.url', + validValues: ['1', 'https://example.org'], + invalidValues: [1, 1.11, null, undefined, [], {}, true] + }, + { + property: 'hazelcast.logging.level', + validValues: ['OFF', 'ERROR', 'WARN', 'INFO', 'DEBUG', 'TRACE'], + invalidValues: [1, 1.11, null, undefined, [], {}, true, 'someOtherString'] + }, + { + property: 'hazelcast.discovery.public.ip.enabled', + validValues: [true, false, null], + invalidValues: [1, 1.11, 'OFF', undefined, '1', '2', [], {}] + } + ]; + + for (const param of params) { + it(`should validate "${param.property}"`, function () { + for (const invalidValue of param.invalidValues) { + expect(() => new ConfigBuilder({ + properties: { + [param.property]: invalidValue + } + }).build()).to.throw(InvalidConfigurationError); + } + + for (const validValue of param.validValues) { + expect(() => new ConfigBuilder({ + properties: { + [param.property]: validValue + } + }).build()).not.to.throw; + } + }); + } + }); + it('should throw InvalidConfigurationError when invalid top level config key is passed', function () { expect(() => new ConfigBuilder({ a: 1 diff --git a/test/unit/config/ConfigPatternMatcherTest.js b/test/unit/config/ConfigPatternMatcherTest.js index 743ea0afb..028049dff 100644 --- a/test/unit/config/ConfigPatternMatcherTest.js +++ b/test/unit/config/ConfigPatternMatcherTest.js @@ -21,7 +21,6 @@ const { FlakeIdGeneratorConfigImpl } = require('../../../lib/config/FlakeIdGener const { ConfigurationError } = require('../../../'); describe('ConfigPatternMatcherTest', function () { - const inputConfig = { flakeIdGenerators: {} }; diff --git a/test/unit/config/FailoverConfigBuilderTest.js b/test/unit/config/FailoverConfigBuilderTest.js index 9deab1206..5e5b41651 100644 --- a/test/unit/config/FailoverConfigBuilderTest.js +++ b/test/unit/config/FailoverConfigBuilderTest.js @@ -21,7 +21,6 @@ const { FailoverConfigBuilder } = require('../../../lib/config/FailoverConfigBui const { ClientConfigImpl } = require('../../../lib/config/Config'); describe('FailoverConfigBuilderTest', function () { - it('should throw for non-number tryCount', function () { const builder = new FailoverConfigBuilder({ tryCount: 'foo', diff --git a/test/unit/config/SchemaValidationTest.js b/test/unit/config/SchemaValidationTest.js index fb3537507..1ce993ee9 100644 --- a/test/unit/config/SchemaValidationTest.js +++ b/test/unit/config/SchemaValidationTest.js @@ -21,7 +21,6 @@ const fs = require('fs'); const path = require('path'); describe('SchemaValidationTest', function () { - let schema; before(function () { diff --git a/test/unit/connection/ClientMessageReaderTest.js b/test/unit/connection/ClientMessageReaderTest.js index 2d0e1793a..a95804213 100644 --- a/test/unit/connection/ClientMessageReaderTest.js +++ b/test/unit/connection/ClientMessageReaderTest.js @@ -22,7 +22,6 @@ const { ClientMessageReader } = require('../../../lib/network/Connection'); const cm = require('../../../lib/protocol/ClientMessage'); describe('ClientMessageReaderTest', function () { - const HEADER_SIZE = cm.SIZE_OF_FRAME_LENGTH_AND_FLAGS; let reader; diff --git a/test/unit/connection/DefaultAddressProviderTest.js b/test/unit/connection/DefaultAddressProviderTest.js index 1d98189bf..58e2d6832 100644 --- a/test/unit/connection/DefaultAddressProviderTest.js +++ b/test/unit/connection/DefaultAddressProviderTest.js @@ -25,7 +25,6 @@ const { DefaultAddressProvider } = require('../../../lib/connection/DefaultAddre const { ClientNetworkConfigImpl } = require('../../../lib/config/ClientNetworkConfig'); describe('DefaultAddressProviderTest', function () { - function addressProvider(...clusterMembers) { const networkConfig = new ClientNetworkConfigImpl(); if (clusterMembers) { diff --git a/test/unit/connection/DirectWriterTest.js b/test/unit/connection/DirectWriterTest.js index 84f25d14f..e9d0f8af8 100644 --- a/test/unit/connection/DirectWriterTest.js +++ b/test/unit/connection/DirectWriterTest.js @@ -28,7 +28,6 @@ const { const { deferredPromise } = require('../../../lib/util/Util'); describe('DirectWriterTest', function () { - let queue; let mockSocket; @@ -121,5 +120,4 @@ describe('DirectWriterTest', function () { done(); }); }); - }); diff --git a/test/unit/connection/FragmentedClientMessageHandlerTest.js b/test/unit/connection/FragmentedClientMessageHandlerTest.js index 55e9806eb..5e9b7b8c2 100644 --- a/test/unit/connection/FragmentedClientMessageHandlerTest.js +++ b/test/unit/connection/FragmentedClientMessageHandlerTest.js @@ -27,7 +27,6 @@ const cm = require('../../../lib/protocol/ClientMessage'); const { FixSizedTypesCodec } = require('../../../lib/codec/builtin/FixSizedTypesCodec'); describe('FragmentedClientMessageHandlerTest', function () { - let reader; let handler; @@ -174,5 +173,4 @@ describe('FragmentedClientMessageHandlerTest', function () { fragment.addFrame(frame); return fragment; }; - }); diff --git a/test/unit/connection/PipelinedWriterTest.js b/test/unit/connection/PipelinedWriterTest.js index fb31ba83a..c9fb1a63d 100644 --- a/test/unit/connection/PipelinedWriterTest.js +++ b/test/unit/connection/PipelinedWriterTest.js @@ -27,7 +27,6 @@ const { const { deferredPromise } = require('../../../lib/util/Util'); describe('PipelinedWriterTest', function () { - const THRESHOLD = 8192; let writer; diff --git a/test/unit/core/BigDecimal.js b/test/unit/core/BigDecimal.js index 152969a37..4698c5987 100644 --- a/test/unit/core/BigDecimal.js +++ b/test/unit/core/BigDecimal.js @@ -20,7 +20,6 @@ chai.should(); const { BigDecimal } = require('../../../lib/core/BigDecimal'); describe('BigDecimalTest', function () { - const constructorTestParams = [ [`1e${Number.MIN_SAFE_INTEGER}`, BigInt(1), -1 * Number.MIN_SAFE_INTEGER], [`1e${Number.MAX_SAFE_INTEGER}`, BigInt(1), -1 * Number.MAX_SAFE_INTEGER], diff --git a/test/unit/core/DatetimeClasses.js b/test/unit/core/DatetimeClasses.js index 0e63ded9c..8b5cb429b 100644 --- a/test/unit/core/DatetimeClasses.js +++ b/test/unit/core/DatetimeClasses.js @@ -207,7 +207,6 @@ describe('DateTimeClassesTest', function () { }); }); describe('LocalDateTimeTest', function () { - it('should throw RangeError if local time is not valid', function () { (() => new LocalDateTime(new LocalDate(2000, 2, 29), '')).should.throw(TypeError, 'Invalid local time'); (() => new LocalDateTime(new LocalDate(2000, 2, 29), 100)).should.throw(TypeError, 'Invalid local time'); @@ -291,7 +290,6 @@ describe('DateTimeClassesTest', function () { }); }); describe('OffsetDateTimeTest', function () { - it('should return parse values correctly', function () { const dateTime1 = new OffsetDateTime(new LocalDateTime(new LocalDate(2000, 2, 29), new LocalTime(2, 3, 4, 6)), 1000); diff --git a/test/unit/core/UuidTest.js b/test/unit/core/UuidTest.js index a5d94854c..d41532936 100644 --- a/test/unit/core/UuidTest.js +++ b/test/unit/core/UuidTest.js @@ -21,7 +21,6 @@ const Long = require('long'); const { UUID } = require('../../../lib/core/UUID'); describe('UuidTest', function () { - it('with small most significant high bits', function () { const uuid = new UUID(new Long(-99999, 1), new Long(213231, -213321)); // Should pad first part with zeros diff --git a/test/unit/discovery/HazelcastCloudConfigTest.js b/test/unit/discovery/HazelcastCloudConfigTest.js index 56ef4d1b1..212631f2a 100644 --- a/test/unit/discovery/HazelcastCloudConfigTest.js +++ b/test/unit/discovery/HazelcastCloudConfigTest.js @@ -20,7 +20,6 @@ const { ClientConfigImpl } = require('../../../lib/config/Config'); const { HazelcastCloudDiscovery } = require('../../../lib/discovery/HazelcastCloudDiscovery'); describe('HazelcastClientCloudConfigTest', function () { - it('defaultCloudUrlEndpoint', function () { const config = new ClientConfigImpl(); const token = 'TOKEN'; diff --git a/test/unit/discovery/HazelcastCloudDiscoveryTest.js b/test/unit/discovery/HazelcastCloudDiscoveryTest.js index 92fc30a55..f57ae0759 100644 --- a/test/unit/discovery/HazelcastCloudDiscoveryTest.js +++ b/test/unit/discovery/HazelcastCloudDiscoveryTest.js @@ -25,7 +25,6 @@ const { AddressImpl } = require('../../../lib/core/Address'); const { HazelcastCloudDiscovery } = require('../../../lib/discovery/HazelcastCloudDiscovery'); describe('HazelcastCloudDiscoveryTest', function () { - let server; async function startUnresponsiveServer(port) { diff --git a/test/unit/discovery/HazelcastCloudProviderTest.js b/test/unit/discovery/HazelcastCloudProviderTest.js index 6583580c8..988dde7d6 100644 --- a/test/unit/discovery/HazelcastCloudProviderTest.js +++ b/test/unit/discovery/HazelcastCloudProviderTest.js @@ -26,7 +26,6 @@ const { HazelcastCloudAddressProvider } = require('../../../lib/discovery/Hazelc const { HazelcastCloudDiscovery } = require('../../../lib/discovery/HazelcastCloudDiscovery'); describe('HazelcastCloudProviderTest', function () { - const expectedAddresses = new Map(); let hazelcastCloudDiscovery; let provider; @@ -102,5 +101,4 @@ describe('HazelcastCloudProviderTest', function () { }); return provider.refresh(); }); - }); diff --git a/test/unit/invocation/InvocationServiceTest.js b/test/unit/invocation/InvocationServiceTest.js index 30f73ee16..d3b436a7e 100644 --- a/test/unit/invocation/InvocationServiceTest.js +++ b/test/unit/invocation/InvocationServiceTest.js @@ -38,7 +38,6 @@ const { ConnectionManager } = require('../../../lib/network/ConnectionManager'); const { deferredPromise } = require('../../../lib/util/Util'); describe('InvocationServiceTest', function () { - let service; function mockClient(config) { diff --git a/test/unit/invocation/InvocationTest.js b/test/unit/invocation/InvocationTest.js index 92adf39f7..b15946017 100644 --- a/test/unit/invocation/InvocationTest.js +++ b/test/unit/invocation/InvocationTest.js @@ -25,7 +25,6 @@ const { LifecycleServiceImpl } = require('../../../lib/LifecycleService'); const { ClientMessage } = require('../../../lib/protocol/ClientMessage'); describe('InvocationTest', function () { - let clientStub; let serviceStub; diff --git a/test/unit/invocation/MurmurTest.js b/test/unit/invocation/MurmurTest.js index 7f221eac8..c6fdf442f 100644 --- a/test/unit/invocation/MurmurTest.js +++ b/test/unit/invocation/MurmurTest.js @@ -19,7 +19,6 @@ const { expect } = require('chai'); const { murmur } = require('../../../lib/invocation/Murmur'); describe('MurmurTest', function () { - // Expected values are from the Java implementation const payloads = [ { input: Buffer.from('key-1'), expected: 1228513025 }, diff --git a/test/unit/nearcache/NearCacheTest.js b/test/unit/nearcache/NearCacheTest.js index f46e14a54..bdde1f927 100644 --- a/test/unit/nearcache/NearCacheTest.js +++ b/test/unit/nearcache/NearCacheTest.js @@ -29,7 +29,6 @@ const { SerializationConfigImpl } = require('../../../lib/config/SerializationCo const { promiseLater } = require('../../TestUtil'); describe('NearCacheTest', function () { - const invalidateOnChange = [false, true]; const ttls = [0, 1]; const evictionPolicy = [EvictionPolicy.LFU, EvictionPolicy.LRU, EvictionPolicy.RANDOM, EvictionPolicy.NONE]; @@ -73,7 +72,6 @@ describe('NearCacheTest', function () { } describe('CacheRecord', function () { - it('does not expire if ttl is 0', function (done) { const rec = new DataRecord(ds('key'), 'value', undefined, 0); setTimeout(() => { @@ -132,7 +130,6 @@ describe('NearCacheTest', function () { }); testConfigs.forEach((testConfig) => { - describe(testConfig.toString(), function () { let nearCache; @@ -234,7 +231,6 @@ describe('NearCacheTest', function () { }); describe('InMemory format', function () { - it('Object', function () { const nearCacheConfig = new NearCacheConfigImpl(); nearCacheConfig.inMemoryFormat = InMemoryFormat.OBJECT; diff --git a/test/unit/network/ConnectionRegistryTest.js b/test/unit/network/ConnectionRegistryTest.js index c66aa259c..6f9c957b0 100644 --- a/test/unit/network/ConnectionRegistryTest.js +++ b/test/unit/network/ConnectionRegistryTest.js @@ -32,7 +32,6 @@ const Util = require('../../../lib/util/Util'); const { ClientOfflineError, IOError } = require('../../../lib/core/HazelcastError'); describe('ConnectionRegistryTest', function () { - const connectionState = { INITIAL: 0, CONNECTED_TO_CLUSTER: 1, @@ -44,7 +43,6 @@ describe('ConnectionRegistryTest', function () { }); describe('getRandomConnection', function () { - it('should call load balancer\'s next() when in smart mode', function () { const loadBalancerStub = {}; loadBalancerStub.next = sandbox.fake.returns(null); diff --git a/test/unit/network/TranslateAddressProviderTest.js b/test/unit/network/TranslateAddressProviderTest.js index b862afaa0..e1e76582d 100644 --- a/test/unit/network/TranslateAddressProviderTest.js +++ b/test/unit/network/TranslateAddressProviderTest.js @@ -31,7 +31,6 @@ const { DefaultAddressProvider } = require('../../../lib/connection/DefaultAddre const { UuidUtil } = require('../../../lib/util/UuidUtil'); describe('TranslateAddressProviderTest', function () { - const PROPERTY_DISCOVERY_PUBLIC_IP_ENABLED = 'hazelcast.discovery.public.ip.enabled'; const REACHABLE_HOST = '127.0.0.1'; const UNREACHABLE_HOST = '192.168.0.1'; diff --git a/test/unit/protocol/ClientErrorFactoryTest.js b/test/unit/protocol/ClientErrorFactoryTest.js index d6e3afac0..c7f7e7151 100644 --- a/test/unit/protocol/ClientErrorFactoryTest.js +++ b/test/unit/protocol/ClientErrorFactoryTest.js @@ -21,7 +21,6 @@ const { ClientErrorFactory } = require('../../../lib/protocol/ErrorFactory'); const { ClientProtocolErrorCodes } = require('../../../lib/protocol/ClientProtocolErrorCodes'); describe('ClientErrorFactoryTest', function () { - const factory = new ClientErrorFactory(); function createErrorHolder(code) { diff --git a/test/unit/protocol/ClientMessageTest.js b/test/unit/protocol/ClientMessageTest.js index 124e06622..05297d4ea 100644 --- a/test/unit/protocol/ClientMessageTest.js +++ b/test/unit/protocol/ClientMessageTest.js @@ -28,7 +28,6 @@ const { const { CodecUtil } = require('../../../lib/codec/builtin/CodecUtil'); describe('ClientMessageTest', function () { - const IS_FINAL_FLAG = 1 << 13; const INT_SIZE_IN_BYTES = 4; diff --git a/test/unit/proxy/cpsubsystem/CPProxyManagerTest.js b/test/unit/proxy/cpsubsystem/CPProxyManagerTest.js index 99431148d..7ad57918f 100644 --- a/test/unit/proxy/cpsubsystem/CPProxyManagerTest.js +++ b/test/unit/proxy/cpsubsystem/CPProxyManagerTest.js @@ -23,7 +23,6 @@ const { } = require('../../../../lib/proxy/cpsubsystem/CPProxyManager'); describe('CPProxyManagerTest', function () { - it('withoutDefaultGroupName: should remove default group from result', function () { expect(withoutDefaultGroupName('test@default')).to.be.equal('test'); expect(withoutDefaultGroupName('test@custom')).to.be.equal('test@custom'); diff --git a/test/unit/proxy/cpsubsystem/CPSessionManagerTest.js b/test/unit/proxy/cpsubsystem/CPSessionManagerTest.js index 5d45b2181..a2e9b2eb2 100644 --- a/test/unit/proxy/cpsubsystem/CPSessionManagerTest.js +++ b/test/unit/proxy/cpsubsystem/CPSessionManagerTest.js @@ -35,13 +35,11 @@ const { RaftGroupId } = require('../../../../lib/proxy/cpsubsystem/RaftGroupId') const { deferredPromise } = require('../../../../lib/util/Util'); describe('CPSessionManagerTest', function () { - afterEach(function () { sandbox.restore(); }); describe('SessionState', function () { - it('acquire: should increment counter', function () { const state = new SessionState(Long.fromNumber(42), null, 1000); @@ -97,7 +95,6 @@ describe('CPSessionManagerTest', function () { }); describe('CPProxySessionManager', function () { - const GROUP_ID = 42; const GROUP_ID_AS_STRING = prepareGroupId().getStringId(); const SESSION_ID = 24; diff --git a/test/unit/proxy/cpsubsystem/FencedLockProxyTest.js b/test/unit/proxy/cpsubsystem/FencedLockProxyTest.js index cd6afbf21..a4b1f6789 100644 --- a/test/unit/proxy/cpsubsystem/FencedLockProxyTest.js +++ b/test/unit/proxy/cpsubsystem/FencedLockProxyTest.js @@ -36,7 +36,6 @@ const { InvocationService } = require('../../../../lib/invocation/InvocationServ const { SerializationServiceV1 } = require('../../../../lib/serialization/SerializationService'); describe('FencedLockProxyTest', function () { - let connectionManagerStub; let cpSessionManagerStub; let serializationServiceStub; diff --git a/test/unit/proxy/cpsubsystem/SemaphoreProxyCommonTest.js b/test/unit/proxy/cpsubsystem/SemaphoreProxyCommonTest.js index 5d9b0d43b..38643d908 100644 --- a/test/unit/proxy/cpsubsystem/SemaphoreProxyCommonTest.js +++ b/test/unit/proxy/cpsubsystem/SemaphoreProxyCommonTest.js @@ -29,7 +29,6 @@ const { InvocationService } = require('../../../../lib/invocation/InvocationServ const { SerializationServiceV1 } = require('../../../../lib/serialization/SerializationService'); describe('SemaphoreProxyCommonTest', function () { - let cpSessionManagerStub; let invocationServiceStub; let serializationServiceStub; @@ -80,7 +79,6 @@ describe('SemaphoreProxyCommonTest', function () { for (const type of testTypes) { describe(`[${type}]`, function () { - it('unlock: should throw for non-number', function () { const proxy = createProxy(type); expect(() => proxy.init('permits')).to.throw(AssertionError); diff --git a/test/unit/proxy/cpsubsystem/SessionAwareSemaphoreProxyTest.js b/test/unit/proxy/cpsubsystem/SessionAwareSemaphoreProxyTest.js index 82ac37d3e..15bb49ca5 100644 --- a/test/unit/proxy/cpsubsystem/SessionAwareSemaphoreProxyTest.js +++ b/test/unit/proxy/cpsubsystem/SessionAwareSemaphoreProxyTest.js @@ -34,7 +34,6 @@ const { ConnectionManager } = require('../../../../lib/network/ConnectionManager const { SerializationServiceV1 } = require('../../../../lib/serialization/SerializationService'); describe('SessionAwareSemaphoreProxyTest', function () { - let cpSessionManagerStub; let connectionManagerStub; let serializationServiceStub; diff --git a/test/unit/ringbuffer/LazyReadResultSetTest.js b/test/unit/ringbuffer/LazyReadResultSetTest.js index 6b34d43d4..caf36c0cb 100644 --- a/test/unit/ringbuffer/LazyReadResultSetTest.js +++ b/test/unit/ringbuffer/LazyReadResultSetTest.js @@ -19,7 +19,6 @@ const { expect } = require('chai'); const { LazyReadResultSet } = require('../../../lib/proxy/ringbuffer/LazyReadResultSet'); describe('LazyReadResultSetTest', function () { - const mockSerializationService = { toObject: (x) => x + 100, isData: (x) => x < 3 diff --git a/test/unit/serialization/APortable.js b/test/unit/serialization/APortable.js index e94afee55..4826e9092 100644 --- a/test/unit/serialization/APortable.js +++ b/test/unit/serialization/APortable.js @@ -16,7 +16,6 @@ 'use strict'; class APortable { - constructor(bool, b, c, d, s, f, i, l, str, p, booleans, bytes, chars, doubles, shorts, floats, ints, longs, strings, portables, identifiedDataSerializable, customStreamSerializableObject, diff --git a/test/unit/serialization/AnIdentifiedDataSerializable.js b/test/unit/serialization/AnIdentifiedDataSerializable.js index 72ae6b381..46c63020c 100644 --- a/test/unit/serialization/AnIdentifiedDataSerializable.js +++ b/test/unit/serialization/AnIdentifiedDataSerializable.js @@ -16,7 +16,6 @@ 'use strict'; class AnIdentifiedDataSerializable { - constructor(bool, b, c, d, s, f, i, l, str, booleans, bytes, chars, doubles, shorts, floats, ints, longs, strings, portable, identifiedDataSerializable, customStreamSerializable, @@ -164,7 +163,6 @@ class AnIdentifiedDataSerializable { dataOutput.writeData(this.data); } - } module.exports = AnIdentifiedDataSerializable; diff --git a/test/unit/serialization/BinaryCompatibilityTest.js b/test/unit/serialization/BinaryCompatibilityTest.js index 41515da67..abf858b7e 100644 --- a/test/unit/serialization/BinaryCompatibilityTest.js +++ b/test/unit/serialization/BinaryCompatibilityTest.js @@ -30,7 +30,6 @@ const { CustomStreamSerializable } = require('./CustomSerializable'); const { expectAlmostEqual } = require('../../TestUtil'); describe('BinaryCompatibilityTest', function () { - const NULL_LENGTH = -1; const versions = [1]; const objects = ReferenceObjects.testObjects; diff --git a/test/unit/serialization/CustomSerializerTest.js b/test/unit/serialization/CustomSerializerTest.js index f3f379c93..31a1863aa 100644 --- a/test/unit/serialization/CustomSerializerTest.js +++ b/test/unit/serialization/CustomSerializerTest.js @@ -20,7 +20,6 @@ const { SerializationServiceV1 } = require('../../../lib/serialization/Serializa const { SerializationConfigImpl } = require('../../../lib/config/SerializationConfig'); describe('CustomSerializerTest', function () { - let service; class CustomObject { diff --git a/test/unit/serialization/DefaultSerializersTest.js b/test/unit/serialization/DefaultSerializersTest.js index 6ddfced76..84411d5c1 100644 --- a/test/unit/serialization/DefaultSerializersTest.js +++ b/test/unit/serialization/DefaultSerializersTest.js @@ -31,7 +31,6 @@ const { } = require('../../../'); describe('DefaultSerializersTest', function () { - const restValue = new RestValue(); restValue.value = '{"test":"data"}'; restValue.contentType = 'text/plain'; diff --git a/test/unit/serialization/GlobalSerializerTest.js b/test/unit/serialization/GlobalSerializerTest.js index 684241ca8..764cbd82c 100644 --- a/test/unit/serialization/GlobalSerializerTest.js +++ b/test/unit/serialization/GlobalSerializerTest.js @@ -20,7 +20,6 @@ const { SerializationConfigImpl } = require('../../../lib/config/SerializationCo const { SerializationServiceV1 } = require('../../../lib/serialization/SerializationService'); describe('GlobalSerializerTest', function () { - let service; function CustomObject(surname) { diff --git a/test/unit/serialization/IdentifiedDataSerializableTest.js b/test/unit/serialization/IdentifiedDataSerializableTest.js index fe6a23acd..ac5023b0e 100644 --- a/test/unit/serialization/IdentifiedDataSerializableTest.js +++ b/test/unit/serialization/IdentifiedDataSerializableTest.js @@ -21,7 +21,6 @@ const { SerializationServiceV1 } = require('../../../lib/serialization/Serializa const TestUtil = require('../../TestUtil'); class IdentifiedDataClass { - constructor(a_byte, a_boolean, a_character, a_short, an_integer, a_long, a_float, a_double, a_string, bytes, booleans, chars, shorts, integers, longs, floats, doubles, strings) { @@ -91,11 +90,9 @@ class IdentifiedDataClass { outp.writeDoubleArray(this.doubles); outp.writeStringArray(this.strings); } - } describe('IdentifiedDataSerializableTest', function () { - const identifiedFactory = (classId) => { if (classId === 1) { return new IdentifiedDataClass(); diff --git a/test/unit/serialization/JsonSerializersTest.js b/test/unit/serialization/JsonSerializersTest.js index 6de72b14f..1703b38d4 100644 --- a/test/unit/serialization/JsonSerializersTest.js +++ b/test/unit/serialization/JsonSerializersTest.js @@ -24,7 +24,6 @@ const { } = require('../../../'); describe('JsonSerializersTest', function () { - const object = { key: 'value' }; const hzJsonValue = new HazelcastJsonValue(JSON.stringify(object)); diff --git a/test/unit/serialization/ObjectDataTest.js b/test/unit/serialization/ObjectDataTest.js index ca166d50b..f50627ef1 100644 --- a/test/unit/serialization/ObjectDataTest.js +++ b/test/unit/serialization/ObjectDataTest.js @@ -24,7 +24,6 @@ const { } = require('../../../lib/serialization/ObjectData'); describe('ObjectDataTest', function () { - const out = new ODOut(null, true); before(function () { out.write(15); diff --git a/test/unit/serialization/PortableObjects.js b/test/unit/serialization/PortableObjects.js index f8cabebd9..9d1f8c9a0 100644 --- a/test/unit/serialization/PortableObjects.js +++ b/test/unit/serialization/PortableObjects.js @@ -18,7 +18,6 @@ const TestUtil = require('../../TestUtil'); class InnerPortable { - constructor(p1, p2) { this.p1 = p1; this.p2 = p2; @@ -35,11 +34,9 @@ class InnerPortable { TestUtil.writeStringToWriter(writer, 'p1', this.p1); TestUtil.writeStringToWriter(writer, 'p2', this.p2); } - } class PortableObject { - constructor( { a_byte, a_boolean, a_character, a_short, an_integer, @@ -156,11 +153,9 @@ class PortableObject { this.timestamps = reader.readTimestampArray('timestamps'); this.timestamp_with_timezones = reader.readTimestampWithTimezoneArray('timestamp_with_timezones'); } - } class PortableObjectV2 { - constructor( { a_new_prop, a_byte, a_boolean, a_character, a_short, an_integer, @@ -279,11 +274,9 @@ class PortableObjectV2 { this.timestamps = reader.readTimestampArray('timestamps'); this.timestamp_with_timezones = reader.readTimestampWithTimezoneArray('timestamp_with_timezones'); } - } class SimplePortable { - constructor(str) { this.aString = str; this.factoryId = 10; @@ -297,11 +290,9 @@ class SimplePortable { writePortable(writer) { TestUtil.writeStringToWriter(writer, 'aString', this.aString); } - } class SimplePortableV3 { - constructor(innerObject) { this.innerObject = innerObject; this.factoryId = 10; @@ -316,11 +307,9 @@ class SimplePortableV3 { writePortable(writer) { writer.writePortable('innerObject', this.innerObject); } - } class Parent { - constructor(child) { this.child = child; this.factoryId = 1; @@ -334,11 +323,9 @@ class Parent { readPortable(reader) { this.child = reader.readPortable('child'); } - } class Child { - constructor(name) { this.name = name; this.factoryId = 1; @@ -352,11 +339,9 @@ class Child { readPortable(reader) { this.name = reader.readString('name'); } - } class DuplicateFieldNamePortable { - constructor(name, surname) { this.name = name; this.surname = surname; @@ -373,7 +358,6 @@ class DuplicateFieldNamePortable { this.name = reader.readString('name'); this.surname = reader.readString('name'); } - } exports.PortableObject = PortableObject; diff --git a/test/unit/serialization/PortableSerializationTest.js b/test/unit/serialization/PortableSerializationTest.js index 23e8f2751..2e46d7da5 100644 --- a/test/unit/serialization/PortableSerializationTest.js +++ b/test/unit/serialization/PortableSerializationTest.js @@ -39,7 +39,6 @@ const chai = require('chai'); chai.should(); describe('PortableSerializationTest', function () { - function createSerializationService(Ctor) { const cfg = new SerializationConfigImpl(); cfg.portableFactories[10] = (classId) => { diff --git a/test/unit/serialization/SerializationServiceTest.js b/test/unit/serialization/SerializationServiceTest.js index e7fef262a..797809bf0 100644 --- a/test/unit/serialization/SerializationServiceTest.js +++ b/test/unit/serialization/SerializationServiceTest.js @@ -104,7 +104,6 @@ CustomSerializer.prototype.write = function (writer, obj) { }; describe('SerializationServiceTest', function () { - it('should use data serializable factory', function () { const serializationConfig = new SerializationConfigImpl(); serializationConfig.dataSerializableFactories[1] = idataSerializableFactory; diff --git a/test/unit/serialization/portable/ClassDefinitionTest.js b/test/unit/serialization/portable/ClassDefinitionTest.js index 8f3dded2d..6168183ee 100644 --- a/test/unit/serialization/portable/ClassDefinitionTest.js +++ b/test/unit/serialization/portable/ClassDefinitionTest.js @@ -21,7 +21,6 @@ const { ClassDefinition, FieldDefinition } = require('../../../../lib/serializat should(); describe('ClassDefinitionTest', function () { - let cd; beforeEach(function () { cd = new ClassDefinition(1, 2, 3); diff --git a/test/unit/serialization/portable/NestedPortableVersionTest.js b/test/unit/serialization/portable/NestedPortableVersionTest.js index be3b79be8..56d791aae 100644 --- a/test/unit/serialization/portable/NestedPortableVersionTest.js +++ b/test/unit/serialization/portable/NestedPortableVersionTest.js @@ -21,7 +21,6 @@ const { Parent, Child } = require('../PortableObjects'); const TestUtil = require('../../../TestUtil'); describe('NestedPortableVersionTest', function () { - it('compatible versions', function () { const sc = new SerializationConfigImpl(); sc.portableVersion = 6; diff --git a/test/unit/sql/SqlPage.js b/test/unit/sql/SqlPage.js index a5db2a752..2d81f7148 100644 --- a/test/unit/sql/SqlPage.js +++ b/test/unit/sql/SqlPage.js @@ -21,7 +21,6 @@ const chai = require('chai'); chai.should(); describe('SqlPageTest', function () { - const columnTypes = [ SqlColumnType.VARCHAR, SqlColumnType.VARCHAR diff --git a/test/unit/sql/SqlResult.js b/test/unit/sql/SqlResult.js index 1297a67ca..90fadda6f 100644 --- a/test/unit/sql/SqlResult.js +++ b/test/unit/sql/SqlResult.js @@ -96,7 +96,6 @@ function simulateExecuteError(timeoutMs, sqlResult, error = new Error('whoops')) describe('SqlResultTest', function () { describe('iteration', function () { - let fakeSqlService; let fakeConnection; let fakeQueryId; @@ -222,10 +221,8 @@ describe('SqlResultTest', function () { err.should.be.eq(executeError); }); }); - }); describe('close', function () { - let fakeSqlService; beforeEach(function () { @@ -370,7 +367,6 @@ describe('SqlResultTest', function () { (await sqlResult2.isRowSet()).should.be.false; (await sqlResult2.getUpdateCount()).eq(long.fromNumber(1)).should.be.true; }); - }); it('should reject after execute error', async function () { @@ -545,7 +541,6 @@ describe('SqlResultTest', function () { fakeQueryId = sandbox.fake(); sqlResult = new SqlResultImpl(fakeSqlService, fakeSerializationService, fakeConnection, fakeQueryId, cursorBufferSize); - }); afterEach(function () { @@ -597,7 +592,6 @@ describe('SqlResultTest', function () { }); }); describe('onNextPage', function () { - it('should close on last page', function () { const sqlResult = new SqlResultImpl({}, {}, {}, {}, 4096); const rowPage = new SqlPage( @@ -633,7 +627,6 @@ describe('SqlResultTest', function () { sqlResult.currentPage.should.be.eq(rowPage); }); - }); describe('onExecuteError', function () { it('should reject execute promise and set update count to long(-1)', async function () { @@ -651,7 +644,6 @@ describe('SqlResultTest', function () { }); }); describe('onExecuteResponse', function () { - let sqlResult; beforeEach(function () { sqlResult = new SqlResultImpl({}, {}, {}, {}, 4096); diff --git a/test/unit/sql/SqlService.js b/test/unit/sql/SqlService.js index f20432fc0..321f31d35 100644 --- a/test/unit/sql/SqlService.js +++ b/test/unit/sql/SqlService.js @@ -54,7 +54,6 @@ describe('SqlServiceTest', function () { const fakeClientUUID = 'asd'; beforeEach(function () { - fakeEncodeRequest = sandbox.replace(SqlExecuteCodec, 'encodeRequest', sandbox.fake.returns(fakeClientMessage)); fakeHandleExecuteResponse = sandbox.replace(SqlServiceImpl, 'handleExecuteResponse', sandbox.fake()); fakeFromMemberId = sandbox.replace(SqlQueryId, 'fromMemberId', sandbox.fake.returns(fakeQueryId)); @@ -347,7 +346,6 @@ describe('SqlServiceTest', function () { } }); }); - }); describe('close', function () { let sqlService; @@ -357,7 +355,6 @@ describe('SqlServiceTest', function () { const fakeClientMessage = {}; beforeEach(function () { - fakeCloseCodec = sandbox.fake.returns(fakeClientMessage); SqlCloseCodec.encodeRequest = fakeCloseCodec; @@ -396,7 +393,6 @@ describe('SqlServiceTest', function () { sandbox.match.same(fakeQueryId) ).should.be.true; }); - }); describe('handleExecuteResponse', function () { const fakeClientMessage = {}; @@ -477,7 +473,6 @@ describe('SqlServiceTest', function () { const fakeRequestMessage = {}; beforeEach(function () { - encodeFake = sandbox.fake.returns(fakeRequestMessage); sandbox.replace(SqlFetchCodec, 'encodeRequest', encodeFake); diff --git a/test/unit/ssl/BasicSSLOptionsFactoryTest.js b/test/unit/ssl/BasicSSLOptionsFactoryTest.js index f3d30307b..86af02183 100644 --- a/test/unit/ssl/BasicSSLOptionsFactoryTest.js +++ b/test/unit/ssl/BasicSSLOptionsFactoryTest.js @@ -20,7 +20,6 @@ const path = require('path'); const { HazelcastError, BasicSSLOptionsFactory } = require('../../../'); describe('BasicSSLOptionsFactoryTest', function () { - it('factory creates sslOptions object with all supported fields', async function () { const options = { servername: 'foo.bar.com', diff --git a/test/unit/statistics/MetricsCompressorTest.js b/test/unit/statistics/MetricsCompressorTest.js index 12e6b874d..9abfcaf90 100644 --- a/test/unit/statistics/MetricsCompressorTest.js +++ b/test/unit/statistics/MetricsCompressorTest.js @@ -28,7 +28,6 @@ const { const { BitsUtil } = require('../../../lib/util/BitsUtil'); describe('MetricsCompressorTest', function () { - const HEADER_SIZE = 6; const INT_SIZE = 4; @@ -129,7 +128,6 @@ describe('MetricsCompressorTest', function () { }); describe('MetricsCompressorTest - OutputBuffer', function () { - it('should increase internal Buffer when necessary', function () { const outputBuffer = new OutputBuffer(1); @@ -204,7 +202,6 @@ describe('MetricsCompressorTest - OutputBuffer', function () { }); describe('MetricsCompressorTest - MetricsDictionary', function () { - it('getDictionaryId: should throw when word is too long', function () { const dictionary = new MetricsDictionary(); diff --git a/test/unit/util/AddressUtilTest.js b/test/unit/util/AddressUtilTest.js index db9d030b0..41edfe3e5 100644 --- a/test/unit/util/AddressUtilTest.js +++ b/test/unit/util/AddressUtilTest.js @@ -25,7 +25,6 @@ const { } = require('../../../lib/util/AddressUtil'); describe('AddressUtilTest', function () { - const host = 'example.com'; const v4Address = '127.0.0.1'; const v6Address = '2001:0db8:85a3:0000:0000:8a2e:0370:7334'; diff --git a/test/unit/util/DatetimeUtil.js b/test/unit/util/DatetimeUtil.js index ecf01a2ce..07b5c2c30 100644 --- a/test/unit/util/DatetimeUtil.js +++ b/test/unit/util/DatetimeUtil.js @@ -123,6 +123,5 @@ describe('DateTimeUtilTest', function () { leftZeroPadInteger(123456, 5) ).to.be.equal('123456'); }); - }); }); diff --git a/test/unit/util/LoadBalancerTest.js b/test/unit/util/LoadBalancerTest.js index a7f020300..88c773608 100644 --- a/test/unit/util/LoadBalancerTest.js +++ b/test/unit/util/LoadBalancerTest.js @@ -21,7 +21,6 @@ const { RandomLB } = require('../../../lib/util/RandomLB'); const { RoundRobinLB } = require('../../../lib/util/RoundRobinLB'); describe('LoadBalancerTest', function () { - const mockMembers = [ { uuid: 0, diff --git a/test/unit/util/UtilTest.js b/test/unit/util/UtilTest.js index e382770ac..75769393a 100644 --- a/test/unit/util/UtilTest.js +++ b/test/unit/util/UtilTest.js @@ -24,7 +24,6 @@ const { } = require('../../../lib/util/Util'); describe('UtilTest', function () { - it('deferredPromise: resolves promise on resolve call', async function () { const deferred = deferredPromise(); let resolveCalled = false; From 7628daa49f92685bf0ff53fb6965358b532839c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Serkan=20=C3=96zel?= Date: Tue, 17 Aug 2021 12:44:07 +0300 Subject: [PATCH 15/15] Revert logging level validation --- src/HazelcastClient.ts | 3 +-- src/config/Config.ts | 4 ++-- src/config/ConfigBuilder.ts | 2 +- src/logging/LoggingService.ts | 4 +++- test/unit/config/ConfigBuilderTest.js | 3 +-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/HazelcastClient.ts b/src/HazelcastClient.ts index 2f362b93e..29860a787 100644 --- a/src/HazelcastClient.ts +++ b/src/HazelcastClient.ts @@ -66,7 +66,6 @@ import {ClientMessage} from './protocol/ClientMessage'; import {Connection} from './network/Connection'; import {ConnectionRegistryImpl} from './network/ConnectionManager'; import {SqlService, SqlServiceImpl} from './sql/SqlService'; -import {LogLevel} from './logging'; /** * Hazelcast client instance. When you want to use Hazelcast's distributed @@ -142,7 +141,7 @@ export class HazelcastClient { this.serializationService = new SerializationServiceV1(this.config.serialization); this.instanceName = this.config.instanceName || 'hz.client_' + this.id; this.loggingService = new LoggingService(this.config.customLogger, - this.config.properties['hazelcast.logging.level'] as LogLevel); + this.config.properties['hazelcast.logging.level'] as string); this.nearCacheManager = new NearCacheManager( this.config, this.serializationService diff --git a/src/config/Config.ts b/src/config/Config.ts index 20010987d..7160dde76 100644 --- a/src/config/Config.ts +++ b/src/config/Config.ts @@ -24,7 +24,7 @@ import {Properties} from './Properties'; import {ReliableTopicConfig, ReliableTopicConfigImpl} from './ReliableTopicConfig'; import {SerializationConfig, SerializationConfigImpl} from './SerializationConfig'; import {Statistics} from '../statistics/Statistics'; -import {ILogger, LogLevel} from '../logging/ILogger'; +import {ILogger} from '../logging/ILogger'; import {ConnectionStrategyConfig, ConnectionStrategyConfigImpl} from './ConnectionStrategyConfig'; import {LoadBalancerConfig, LoadBalancerConfigImpl} from './LoadBalancerConfig'; @@ -170,7 +170,7 @@ const DEFAULT_PROPERTIES: Properties = { 'hazelcast.invalidation.reconciliation.interval.seconds': 60, 'hazelcast.invalidation.max.tolerated.miss.count': 10, 'hazelcast.invalidation.min.reconciliation.interval.seconds': 30, - 'hazelcast.logging.level': LogLevel.INFO, + 'hazelcast.logging.level': 'INFO', 'hazelcast.client.autopipelining.enabled': true, 'hazelcast.client.autopipelining.threshold.bytes': 65536, 'hazelcast.client.socket.no.delay': true, diff --git a/src/config/ConfigBuilder.ts b/src/config/ConfigBuilder.ts index 59de409d0..a5c5256d6 100644 --- a/src/config/ConfigBuilder.ts +++ b/src/config/ConfigBuilder.ts @@ -261,7 +261,7 @@ export class ConfigBuilder { value = tryGetNumber(value); break; case 'hazelcast.logging.level': - value = tryGetEnum(LogLevel, value); + tryGetEnum(LogLevel, value); break; case 'hazelcast.client.autopipelining.enabled': value = tryGetBoolean(value); diff --git a/src/logging/LoggingService.ts b/src/logging/LoggingService.ts index 10eae98c3..68e350286 100644 --- a/src/logging/LoggingService.ts +++ b/src/logging/LoggingService.ts @@ -18,14 +18,16 @@ import {Property} from '../config/Properties'; import {DefaultLogger} from './DefaultLogger'; import {ILogger, LogLevel} from './ILogger'; +import {enumFromString} from '../util/Util'; /** @internal */ export class LoggingService { private readonly logger: ILogger; - constructor(customLogger: ILogger, logLevel: LogLevel) { + constructor(customLogger: ILogger, level: string) { if (customLogger == null) { + const logLevel = enumFromString(LogLevel, level); this.logger = new DefaultLogger(logLevel); } else if (this.isLogger(customLogger)) { this.logger = customLogger; diff --git a/test/unit/config/ConfigBuilderTest.js b/test/unit/config/ConfigBuilderTest.js index 4df1208ff..19735af38 100644 --- a/test/unit/config/ConfigBuilderTest.js +++ b/test/unit/config/ConfigBuilderTest.js @@ -32,7 +32,6 @@ const { createAddressFromString } = require('../../../lib/util/AddressUtil'); const { ReconnectMode } = require('../../../lib/config/ConnectionStrategyConfig'); -const { LogLevel } = require('../../../lib/logging/ILogger'); describe('ConfigBuilderTest', function () { let fullConfig; @@ -152,7 +151,7 @@ describe('ConfigBuilderTest', function () { expect(properties['hazelcast.invalidation.reconciliation.interval.seconds']).equal(50); expect(properties['hazelcast.invalidation.max.tolerated.miss.count']).to.equal(15); expect(properties['hazelcast.invalidation.min.reconciliation.interval.seconds']).to.equal(60); - expect(properties['hazelcast.logging.level']).to.be.equal(LogLevel.OFF); + expect(properties['hazelcast.logging.level']).to.be.equal('OFF'); expect(properties['hazelcast.client.autopipelining.enabled']).to.be.false; expect(properties['hazelcast.client.autopipelining.threshold.bytes']).to.equal(1024); expect(properties['hazelcast.client.socket.no.delay']).to.be.false;