Skip to content

Commit

Permalink
bug 1736928: remove write_combine_size
Browse files Browse the repository at this point in the history
This fix is a bit more involved than it should be because we were using
this field as an example of nested field and field searching in the
tests. I switched this field out for another so we're cool.
  • Loading branch information
willkg committed Nov 17, 2021
1 parent 529b6a6 commit d67843c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 37 deletions.
1 change: 0 additions & 1 deletion socorro/external/es/crashstorage.py
Expand Up @@ -606,7 +606,6 @@ class ESCrashStorageRedactedJsonDump(ESCrashStorageRedactedSave):
name="json_dump_allowlist_keys",
doc="keys of the json_dump field to keep in the processed crash",
default=[
"write_combine_size",
"stackwalk_version",
"system_info",
],
Expand Down
14 changes: 0 additions & 14 deletions socorro/external/es/super_search_fields.py
Expand Up @@ -3249,20 +3249,6 @@ def number_field(
"type": "string",
},
},
"write_combine_size": {
"data_validation_type": "int",
"description": "",
"form_field_choices": [],
"has_full_version": False,
"in_database_name": "write_combine_size",
"is_exposed": True,
"is_returned": True,
"name": "write_combine_size",
"namespace": "processed_crash.json_dump",
"permissions_needed": [],
"query_type": "number",
"storage_mapping": {"type": "long"},
},
"xpcom_spin_event_loop_stack": keyword_field(
name="xpcom_spin_event_loop_stack",
description=(
Expand Down
7 changes: 0 additions & 7 deletions socorro/schemas/telemetry_socorro_crash.json
Expand Up @@ -684,13 +684,6 @@
}
}
}
},
"write_combine_size": {
"type": [
"string",
"null"
],
"description": "If present, the total size of all committed memory regions in the crashing process marked with PAGE_WRITECOMBINE."
}
}
},
Expand Down
4 changes: 0 additions & 4 deletions socorro/unittest/external/es/test_crashstorage.py
Expand Up @@ -54,7 +54,6 @@
"id": 361399767,
"json_dump": {
"things": "stackwalker output",
"write_combine_size": 43,
"system_info": {"cpu_count": 42, "os": "Linux"},
},
"install_age": 22385,
Expand Down Expand Up @@ -350,7 +349,6 @@ def test_success_with_limited_json_dump_class(self, espy_mock):
"""Test a successful index of a crash report"""
modified_config = self.get_tuned_config(ESCrashStorage)
modified_config.json_dump_allowlist_keys = [
"write_combine_size",
"system_info",
]
modified_config.es_redactor = DotDict()
Expand All @@ -377,7 +375,6 @@ def test_success_with_limited_json_dump_class(self, espy_mock):
"json_dump": {
# json dump allowed keys
"system_info": {"cpu_count": 42, "os": "Linux"},
"write_combine_size": 43,
# not allowed keys:
"badkey1": "foo",
"badkey2": {"badsubkey": "foo"},
Expand Down Expand Up @@ -419,7 +416,6 @@ def test_success_with_limited_json_dump_class(self, espy_mock):
"json_dump": {
# json dump allowed keys
"system_info": {"cpu_count": 42},
"write_combine_size": 43,
},
},
}
Expand Down
13 changes: 6 additions & 7 deletions socorro/unittest/external/es/test_super_search_fields.py
Expand Up @@ -129,13 +129,12 @@ def test_get_mapping(self):
}

# Test nested objects.
assert "json_dump" in processed_crash
assert "properties" in processed_crash["json_dump"]
assert "write_combine_size" in processed_crash["json_dump"]["properties"]
assert processed_crash["json_dump"]["properties"]["write_combine_size"] == {
"type": "long",
"doc_values": True,
}
assert (
processed_crash["json_dump"]["properties"]["system_info"]["properties"]["cpu_count"] == {
"type": "short",
"doc_values": True,
}
)


class TestIntegrationSuperSearchFields(ElasticsearchTestCase):
Expand Down
12 changes: 8 additions & 4 deletions socorro/unittest/external/es/test_supersearch.py
Expand Up @@ -91,13 +91,17 @@ def test_get(self):
"date_processed": self.now,
"build": 20000000,
"os_name": "Linux",
"json_dump": {"write_combine_size": 9823012},
"json_dump": {
"system_info": {
"cpu_count": 4,
},
}
}
)
self.es_context.refresh()

res = self.api.get(
_columns=["date", "build_id", "platform", "signature", "write_combine_size"]
_columns=["date", "build_id", "platform", "signature", "cpu_count"]
)

assert "hits" in res
Expand All @@ -120,8 +124,8 @@ def test_get(self):
assert "platform" in res["hits"][0] # os_name -> platform

# Test namespaces are correctly removed.
# processed_crash.json_dump.write_combine_size > write_combine_size
assert "write_combine_size" in res["hits"][0]
# processed_crash.json_dump.system_info.cpu_count -> cpu_count
assert "cpu_count" in res["hits"][0]

def test_get_with_bad_results_number(self):
"""Run a very basic test, just to see if things work"""
Expand Down

0 comments on commit d67843c

Please sign in to comment.