Skip to content

Commit

Permalink
Merge pull request naver#913 from naver/release/3.5.6
Browse files Browse the repository at this point in the history
Release 3.5.6
  • Loading branch information
imbyungjun authored Oct 7, 2022
2 parents 9cdf44a + e9ef0d8 commit b2da67d
Show file tree
Hide file tree
Showing 57 changed files with 26,479 additions and 866 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/gradle.yml

This file was deleted.

76 changes: 76 additions & 0 deletions .github/workflows/run-build-with-test-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Run Build with Tests on PR

on:
pull_request:
types:
- opened
- synchronize
branches:
- develop
- master

concurrency:
group: ${{ github.head_ref }}-run-build-with-tests
cancel-in-progress: true

jobs:
build-and-run-unit-test:
name: "Build & Test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup JDK 8
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8.0.345'
architecture: x64
cache: 'gradle'

- name: Execute Gradle Build
run: ./gradlew clean test --console=plain

- name: Publish Test Report
uses: mikepenz/[email protected]
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
fail_on_failure: true
annotate_only: false
check_name: Test Report

- name: Delete previous comment of Github Actions Bot
uses: izhangzhihao/delete-comment@master
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_user_name: github-actions[bot]
issue_number: ${{ github.event.number }}

- name: Notify current workflow is succeed
uses: actions/github-script@v6
if: success()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: 'naver',
repo: 'ngrinder',
body: '✅ Build & Test workflow succeed ✅\n- [Show details](https://github.com/naver/ngrinder/actions/runs/${{ github.run_id }})'
})
- name: Notify current workflow is failed
uses: actions/github-script@v6
if: failure()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: ${{ github.event.pull_request.number }},
owner: 'naver',
repo: 'ngrinder',
body: '❌ Build & Test workflow failed ❌\n- [Show details](https://github.com/naver/ngrinder/actions/runs/${{ github.run_id }})'
})
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ target/
build/
~$*
**/node_modules
package-lock.json
/Servers
/.metadata
/ngrinder-core-3.*
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
* Please post questions in [Discussions](https://github.com/naver/ngrinder/discussions) not Issues.
* nGrinder 3.5.5-p1 has been released. See https://github.com/naver/ngrinder/releases
* nGrinder 3.5.6 has been released. See https://github.com/naver/ngrinder/releases
* Currently, we are working on the internal project not ngrinder. We will resume ngrinder dev from July, 2022.

nGrinder
========
Expand Down Expand Up @@ -101,11 +102,10 @@ Found the apparent bug? Got a brilliant idea for an enhancement? Please create a
* https://github.com/naver/ngrinder/issues

You can join our forum as well
* Dev : http://ngrinder.642.n7.nabble.com/ngrinder-dev-f1.html
* User Forum : http://ngrinder.642.n7.nabble.com/ngrinder-user-f50.html
* 中文论坛 (Chinese) : http://ngrinder.642.n7.nabble.com/ngrinder-user-cn-f114.html
* 한국어 유저 포럼 (Korean): http://ngrinder.642.n7.nabble.com/ngrinder-user-kr-f113.html
* [![Developer chat at https://gitter.im/naver/ngrinder-kr](https://badges.gitter.im/naver/ngrinder-kr.svg)](https://gitter.im/naver/ngrinder-kr?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
* Dev : http://ngrinder.373.s1.nabble.com/ngrinder-dev-f1.html
* User Forum : http://ngrinder.373.s1.nabble.com/ngrinder-user-f50.html
* 中文论坛 (Chinese) : http://ngrinder.373.s1.nabble.com/ngrinder-user-cn-f114.html
* 한국어 유저 포럼 (Korean): http://ngrinder.373.s1.nabble.com/ngrinder-user-kr-f113.html


License
Expand Down
13 changes: 13 additions & 0 deletions RELEASE-NOTE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
3.5.6 (2022.10.10)
==================
- Changes
- Bump OSHI up to 6.1.6 to support M1 arch
- Bump select2 version up
- Change Jython test thread shutdown log level
- Change nabble forum URL
- Fix scm-manager maven repo URL
- Remove ES-Check gradle task

- Bug fix
- #897 Fix the script content is lost after validation check

3.5.5-p1 (2021.05.31)
==================
- Bug fix
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ allprojects {
apply plugin: "idea"

group = "org.ngrinder"
version = "3.5.5-p1"
version = "3.5.6"

idea {
module {
Expand Down Expand Up @@ -51,7 +51,7 @@ subprojects {
repositories {
mavenCentral()
maven { url "https://repo.springsource.org/release" }
maven { url "https://maven.scm-manager.org/nexus/content/repositories/releases" }
maven { url "https://packages.scm-manager.org/repository/releases" }
}

test {
Expand Down
12 changes: 6 additions & 6 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ nGrinder is a platform for stress tests that enables you to execute script creat
nGrinder consists of two major components.

* __controller__ : a web application that enables the performance tester to create a test script and configure a test run. You can get the controller docker images [ngrinder/controller](https://registry.hub.docker.com/u/ngrinder/controller/).
* __controller__ : a web application that enables the performance tester to create a test script and configure a test run. You can get the controller docker images [ngrinder/controller](https://registry.hub.docker.com/r/ngrinder/controller).

* __agent__ : a virtual user generator that creates loads. You can get the agent docker images [ngrinder/agent](https://registry.hub.docker.com/u/ngrinder/agent/).
* __agent__ : a virtual user generator that creates loads. You can get the agent docker images [ngrinder/agent](https://registry.hub.docker.com/r/ngrinder/agent).

Version
---------
Expand All @@ -27,13 +27,13 @@ Install docker 1.5.0 or above on your host.
Pull the ngrinder/controller image.

```
$ docker pull ngrinder-controller:3.4
$ docker pull ngrinder/controller:3.5.6
```

Start controller.

```
docker run -d -v ~/ngrinder-controller:/opt/ngrinder-controller -p 80:80 -p 16001:16001 -p 12000-12009:12000-12009 ngrinder-controller:3.4
docker run -d -v ~/ngrinder-controller:/opt/ngrinder-controller -p 80:80 -p 16001:16001 -p 12000-12009:12000-12009 ngrinder/controller:3.5.6
```

The controller creates a data folder under /opt/ngrinder-controller to maintain test history and configuration data. In order to keep the data persistently, you should map the folder /opt/ngrinder-controller on the container to a folder on your host .
Expand All @@ -54,11 +54,11 @@ Install docker 1.5.0 or above on your another host. You should run your agent on
Pull the ngrinder/agent image.

```
$ docker pull ngrinder/agent:3.4
$ docker pull ngrinder/agent:3.5.6
```

Start agent.

```
docker run -v ~/ngrinder-agent:/opt/ngrinder-agent -d ngrinder/agent:3.4 controller_ip:controller_web_port
docker run -v ~/ngrinder-agent:/opt/ngrinder-agent -d ngrinder/agent:3.5.6 controller_ip:controller_web_port
```
2 changes: 1 addition & 1 deletion docker/agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM jeanblanchard/java:serverjre-8
MAINTAINER JunHo Yoon "[email protected]"

RUN apk update; apk add curl bash
RUN apk update; apk add curl bash udev


# Set up environment variables
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ org.gradle.daemon=true
jna.version=5.6.0
groovy.version=3.0.5
junit.version=4.13.1
org.gradle.caching = true

#signing.keyId={please_input_your_gpg_key}
#signing.password={please_input_your_gpg_key_password}
Expand Down
1 change: 0 additions & 1 deletion ngrinder-controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ test {
tasks.bootWar.dependsOn convert_cr_lf

tasks.processResources.finalizedBy tasks.getByPath(":ngrinder-frontend:webpack")
tasks.processResources.finalizedBy tasks.getByPath(":ngrinder-frontend:checkES5")
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ public interface ControllerConstants {
String PROP_CONTROLLER_ENABLE_STATISTICS = "controller.enable_statistics";
String PROP_CONTROLLER_CSV_SEPARATOR = "controller.csv_separator";
String PROP_CONTROLLER_GITHUB_BASE_URL = "controller.github_base_url";
String PROP_CONTROLLER_IGNORE_TOO_LOW_TPS = "controller.ignore_too_low_tps";
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.concurrent.ConcurrentHashMap;

import static java.util.concurrent.TimeUnit.SECONDS;
import static net.grinder.util.NetworkUtils.DEFAULT_LOCAL_HOST_ADDRESS;
import static org.apache.commons.lang.ArrayUtils.EMPTY_STRING_ARRAY;
import static org.ngrinder.common.constant.CacheConstants.*;
import static org.ngrinder.common.util.ObjectUtils.defaultIfNull;
Expand Down Expand Up @@ -109,7 +108,7 @@ public HazelcastInstance hazelcastInstance() {
String[] clusterURIs = defaultIfNull(getClusterURIs(), EMPTY_STRING_ARRAY);

if ("easy".equals(clusterMode)) {
tcpIpConfig.addMember(DEFAULT_LOCAL_HOST_ADDRESS);
tcpIpConfig.addMember(NetworkUtils.getLocalHostAddress());
} else {
networkConfig.setPort(getClusterPort()).setPortAutoIncrement(false);
if (clusterURIs.length > 0) {
Expand Down Expand Up @@ -243,7 +242,7 @@ protected String[] getClusterURIs() {
}

private String getClusterHostName() {
String hostName = config.getClusterProperties().getProperty(PROP_CLUSTER_HOST, DEFAULT_LOCAL_HOST_ADDRESS);
String hostName = config.getClusterProperties().getProperty(PROP_CLUSTER_HOST, NetworkUtils.getLocalHostAddress());
try {
//noinspection ResultOfMethodCallIgnored
InetAddress.getByName(hostName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.ngrinder.infra.hazelcast.task;

import com.hazelcast.spring.context.SpringAware;
import net.grinder.util.NetworkUtils;
import org.ngrinder.infra.config.Config;
import org.ngrinder.region.model.RegionInfo;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -10,7 +11,6 @@
import java.util.Set;
import java.util.concurrent.Callable;

import static net.grinder.util.NetworkUtils.DEFAULT_LOCAL_HOST_ADDRESS;
import static org.apache.commons.lang.StringUtils.defaultIfBlank;
import static org.ngrinder.common.constant.CacheConstants.REGION_ATTR_KEY;
import static org.ngrinder.common.constant.CacheConstants.SUBREGION_ATTR_KEY;
Expand All @@ -28,7 +28,7 @@ public class RegionInfoTask implements Callable<RegionInfo>, Serializable {
private transient Config config;

public RegionInfo call() {
final String regionIP = defaultIfBlank(config.getCurrentIP(), DEFAULT_LOCAL_HOST_ADDRESS);
final String regionIP = defaultIfBlank(config.getCurrentIP(), NetworkUtils.getLocalHostAddress());
Map<String, String> regionWithSubregion = config.getRegionWithSubregion();
Set<String> subregion = convertSubregionsStringToSet(regionWithSubregion.get(SUBREGION_ATTR_KEY));
return new RegionInfo(regionWithSubregion.get(REGION_ATTR_KEY), subregion, regionIP, config.getControllerPort());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.grinder.console.communication.ConsoleCommunicationImplementationEx;
import net.grinder.console.model.ConsoleCommunicationSetting;
import net.grinder.console.model.ConsoleProperties;
import net.grinder.util.NetworkUtils;
import org.apache.commons.lang.StringUtils;
import org.ngrinder.infra.config.Config;
import org.ngrinder.perftest.model.NullSingleConsole;
Expand All @@ -34,7 +35,6 @@
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;

import static net.grinder.util.NetworkUtils.DEFAULT_LOCAL_HOST_ADDRESS;
import static net.grinder.util.NetworkUtils.getAvailablePorts;
import static org.apache.commons.lang.StringUtils.defaultIfEmpty;
import static org.ngrinder.common.constant.ControllerConstants.*;
Expand Down Expand Up @@ -72,7 +72,7 @@ public class ConsoleManager {
public void init() {
int consoleSize = getConsoleSize();
consoleQueue = new ArrayBlockingQueue<>(consoleSize);
final String currentIP = defaultIfEmpty(config.getCurrentIP(), DEFAULT_LOCAL_HOST_ADDRESS);
final String currentIP = defaultIfEmpty(config.getCurrentIP(), NetworkUtils.getLocalHostAddress());
for (int port : getAvailablePorts(currentIP, consoleSize, getConsolePortBase(), MAX_PORT_NUMBER)) {
final ConsoleEntry consoleEntry = new ConsoleEntry(currentIP, port);
try {
Expand Down Expand Up @@ -150,7 +150,7 @@ public SingleConsole getAvailableConsole(ConsoleProperties baseConsoleProperties
consoleCommunicationSetting.setInactiveClientTimeOut(config.getInactiveClientTimeOut());
}
SingleConsole singleConsole = new SingleConsole(config.getCurrentIP(), consoleEntry.getPort(),
consoleCommunicationSetting, baseConsoleProperties);
consoleCommunicationSetting, baseConsoleProperties);
getConsoleInUse().add(singleConsole);
singleConsole.setCsvSeparator(config.getCsvSeparator());
return singleConsole;
Expand Down Expand Up @@ -180,7 +180,7 @@ public void returnBackConsole(String testIdentifier, SingleConsole console) {
console.sendStopMessageToAgents();
} catch (Exception e) {
LOG.error("Exception occurred during console return back for test {}.",
testIdentifier, e);
testIdentifier, e);
// But the port is getting back.
} finally {
// This is very careful implementation..
Expand All @@ -189,15 +189,15 @@ public void returnBackConsole(String testIdentifier, SingleConsole console) {
console.waitUntilAllAgentDisconnected();
} catch (Exception e) {
LOG.error("Exception occurred during console return back for test {}.",
testIdentifier, e);
testIdentifier, e);
// If it's not disconnected still, stop them by force.
agentManager.stopAgent(console.getConsolePort());
}
try {
console.shutdown();
} catch (Exception e) {
LOG.error("Exception occurred during console return back for test {}.",
testIdentifier, e);
testIdentifier, e);
}
int consolePort;
String consoleIP;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.ngrinder.agent.service.AgentService;
import org.ngrinder.common.constant.ControllerConstants;
import org.ngrinder.common.exception.PerfTestPrepareException;
import org.ngrinder.common.util.PropertiesWrapper;
import org.ngrinder.extension.OnTestLifeCycleRunnable;
import org.ngrinder.extension.OnTestSamplingRunnable;
import org.ngrinder.infra.config.Config;
Expand Down Expand Up @@ -383,6 +384,15 @@ void startAgentsOn(PerfTest perfTest, GrinderProperties grinderProperties, Singl
+ " agents are ready.");
}

private boolean isValidStopReason(StopReason stopReason) {
PropertiesWrapper properties = config.getControllerProperties();
if (stopReason == StopReason.TOO_LOW_TPS &&
properties.getPropertyBoolean(PROP_CONTROLLER_IGNORE_TOO_LOW_TPS, false)) {
return true;
}
return false;
}

/**
* Run a given {@link PerfTest} with the given {@link GrinderProperties} and
* the {@link SingleConsole} .
Expand All @@ -404,6 +414,9 @@ void runTestOn(final PerfTest perfTest, GrinderProperties grinderProperties, fin
singleConsole.addListener(stopReason -> {
PerfTest fetchedPerftest = perfTestService.getOne(perfTest.getId());
if (fetchedPerftest.getStatus().isStoppable()) {
if (isValidStopReason(stopReason)) {
return;
}
perfTestService.markAbnormalTermination(perfTest, stopReason);
LOG.error(format(perfTest, "Abnormal test due to {}", stopReason.name()));
}
Expand Down
Loading

0 comments on commit b2da67d

Please sign in to comment.