Skip to content

Commit

Permalink
Fix remote_write flaky test (#21173)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrsMark committed Sep 21, 2020
1 parent ab3ee63 commit e770f32
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 22 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Disable Kafka metricsets based on Jolokia by default. They require a different configuration. {pull}20989[20989]
- Fix panic index out of range error when getting AWS account name. {pull}21101[21101] {issue}21095[21095]
- Handle missing counters in the application_pool metricset. {pull}21071[21071]
- Fix remote_write flaky test. {pull}21173[21173]

*Packetbeat*

Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/prometheus/_meta/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rule_files:
# - "second_rules.yml"

remote_write:
- url: "http://REMOTE/write"
- url: "http://0.0.0.0:9201/write"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
Expand Down
20 changes: 0 additions & 20 deletions metricbeat/module/prometheus/_meta/run.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
#!/bin/sh


for i in 1 2 3 4 5;
do
a=`nslookup host.docker.internal | grep "** server can't find " | wc -l`;
if [ $a -gt 0 ]; then
# this works only on Linux envs
HOST_DOMAIN="0.0.0.0"
else
# this works only on Mac envs
HOST_DOMAIN="host.docker.internal"
break
fi
done



REMOTE="$HOST_DOMAIN:9201"

sed -i "s/REMOTE/$REMOTE/g" /etc/prometheus/prometheus.yml

/bin/prometheus --config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/prometheus \
--web.console.libraries=/usr/share/prometheus/console_libraries \
Expand Down
1 change: 0 additions & 1 deletion metricbeat/module/prometheus/test_prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def test_query(self):
self.assert_fields_are_documented(evt)


@unittest.skip("Flaky test: https://github.com/elastic/beats/issues/20967")
class TestRemoteWrite(metricbeat.BaseTest):

COMPOSE_SERVICES = ['prometheus-host-network']
Expand Down

0 comments on commit e770f32

Please sign in to comment.