Skip to content

Commit 9303539

Browse files
committed
fix: address PR feedback for ES data streams and anonymizer CI
Corrected startTime precision to long in ES8 mapping templates. Fixed flaky anonymizer tests by using a robust directory trigger instead of chmod. Verified backward compatibility for legacy index trace lookups. Signed-off-by: SoumyaRaikwar <somuraik@gmail.com>
1 parent 14bb6e0 commit 9303539

File tree

4 files changed

+168
-204
lines changed

4 files changed

+168
-204
lines changed

cmd/anonymizer/app/uiconv/extractor_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,11 @@ func TestExtractorTraceSuccess(t *testing.T) {
5050

5151
func TestExtractorTraceOutputFileError(t *testing.T) {
5252
inputFile := "fixtures/trace_success.json"
53-
outputFile := "fixtures/trace_success_ui_anonymized.json"
54-
defer os.Remove(outputFile)
53+
outputFile := t.TempDir() // Intentionally use a directory to trigger an error
5554

5655
reader, err := newSpanReader(inputFile, zap.NewNop())
5756
require.NoError(t, err)
5857

59-
err = os.Chmod("fixtures", 0o000)
60-
require.NoError(t, err)
61-
defer os.Chmod("fixtures", 0o755)
62-
6358
_, err = newExtractor(
6459
outputFile,
6560
"2be38093ead7a083",

cmd/anonymizer/app/uiconv/module_test.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,14 @@ func TestModule_TraceNonExistent(t *testing.T) {
5353

5454
func TestModule_TraceOutputFileError(t *testing.T) {
5555
inputFile := "fixtures/trace_success.json"
56-
outputFile := "fixtures/trace_success_ui_anonymized.json"
57-
defer os.Remove(outputFile)
56+
outputFile := t.TempDir() // Intentionally use a directory to trigger an error
5857

5958
config := Config{
6059
CapturedFile: inputFile,
6160
UIFile: outputFile,
6261
TraceID: "2be38093ead7a083",
6362
}
6463

65-
err := os.Chmod("fixtures", 0o550)
66-
require.NoError(t, err)
67-
defer os.Chmod("fixtures", 0o755)
68-
69-
err = Extract(config, zap.NewNop())
64+
err := Extract(config, zap.NewNop())
7065
require.ErrorContains(t, err, "cannot create output file")
7166
}

internal/storage/v1/elasticsearch/mappings/fixtures/jaeger-span-8.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
"ignore_above": 256
6161
},
6262
"startTime": {
63-
"type": "date",
64-
"format": "epoch_millis"
63+
"type": "long"
6564
},
6665
"startTimeMillis": {
6766
"type": "date",
@@ -78,8 +77,7 @@
7877
"dynamic": false,
7978
"properties": {
8079
"timestamp": {
81-
"type": "date",
82-
"format": "epoch_millis"
80+
"type": "long"
8381
},
8482
"fields": {
8583
"type": "nested",

0 commit comments

Comments
 (0)