This is an automated email from the ASF dual-hosted git repository. ddanielr pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push: new 0ab8c80768 Fix failing test (#4776) 0ab8c80768 is described below commit 0ab8c807680bcab2c075961bb784661fecc00867 Author: Daniel Roberts <ddani...@gmail.com> AuthorDate: Mon Jul 29 16:46:31 2024 -0400 Fix failing test (#4776) * Fix failing test Updated reference from using old row location to column qualifier for file path. * Use ScanServerRefTabletFile instead of direct CF Use the ScanServerRefTabletFile instead of a direct reference to the columnFamily. --- .../accumulo/test/ScanServerMetadataEntriesIT.java | 68 +++++++++++----------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/test/src/main/java/org/apache/accumulo/test/ScanServerMetadataEntriesIT.java b/test/src/main/java/org/apache/accumulo/test/ScanServerMetadataEntriesIT.java index da0e141732..9aef8ac676 100644 --- a/test/src/main/java/org/apache/accumulo/test/ScanServerMetadataEntriesIT.java +++ b/test/src/main/java/org/apache/accumulo/test/ScanServerMetadataEntriesIT.java @@ -231,43 +231,41 @@ public class ScanServerMetadataEntriesIT extends SharedMiniClusterBase { Iterator<Entry<Key,Value>> iter = scanner.iterator(); assertTrue(iter.hasNext()); assertNotNull(iter.next()); - - List<Entry<Key,Value>> metadataEntries = null; - try (Scanner scanner2 = - client.createScanner(AccumuloTable.SCAN_REF.tableName(), Authorizations.EMPTY)) { - metadataEntries = scanner2.stream().distinct().collect(Collectors.toList()); - } - assertEquals(fileCount, metadataEntries.size()); - metadataEntries.forEach(e -> log.info("{}", e.getKey())); - - Set<String> metadataScanFileRefs = new HashSet<>(); - metadataEntries.forEach(m -> { - String file = m.getKey().getRow().toString(); - metadataScanFileRefs.add(file); - }); - assertEquals(fileCount, metadataScanFileRefs.size()); - - assertEquals(fileCount, ctx.getAmple().scanServerRefs().list().count()); - List<Reference> refs; - try (Stream<Reference> references = gc.getReferences()) { - refs = references.collect(Collectors.toList()); - } - assertTrue(refs.size() > fileCount * 2); - List<Reference> tableRefs = - refs.stream().filter(r -> r.getTableId().equals(tid) && !r.isDirectory()) - .peek(r -> assertTrue(metadataScanFileRefs.contains(r.getMetadataPath()))) - .collect(Collectors.toList()); - log.info("Reference List:{}", tableRefs); - // There should be 6 references here. 3 for the table file entries, and 3 for the scan - // server references - assertEquals(fileCount * 2, tableRefs.size()); - - Set<String> deduplicatedReferences = - tableRefs.stream().map(Reference::getMetadataPath).collect(Collectors.toSet()); - - assertEquals(fileCount, deduplicatedReferences.size()); } + List<Entry<Key,Value>> metadataEntries = null; + try (Scanner scanner2 = + client.createScanner(AccumuloTable.SCAN_REF.tableName(), Authorizations.EMPTY)) { + metadataEntries = scanner2.stream().distinct().collect(Collectors.toList()); + } + assertEquals(fileCount, metadataEntries.size()); + metadataEntries.forEach(e -> log.info("{}", e.getKey())); + + Set<String> metadataScanFileRefs = new HashSet<>(); + metadataEntries.forEach(m -> { + metadataScanFileRefs.add(new ScanServerRefTabletFile(m.getKey()).getFilePath().toString()); + }); + assertEquals(fileCount, metadataScanFileRefs.size()); + + assertEquals(fileCount, ctx.getAmple().scanServerRefs().list().count()); + List<Reference> refs; + try (Stream<Reference> references = gc.getReferences()) { + refs = references.collect(Collectors.toList()); + } + assertTrue(refs.size() > fileCount * 2); + List<Reference> tableRefs = + refs.stream().filter(r -> r.getTableId().equals(tid) && !r.isDirectory()) + .peek(r -> assertTrue(metadataScanFileRefs.contains(r.getMetadataPath()))) + .collect(Collectors.toList()); + log.info("Reference List:{}", tableRefs); + // There should be 6 references here. 3 for the table file entries, and 3 for the scan + // server references + assertEquals(fileCount * 2, tableRefs.size()); + + Set<String> deduplicatedReferences = + tableRefs.stream().map(Reference::getMetadataPath).collect(Collectors.toSet()); + + assertEquals(fileCount, deduplicatedReferences.size()); client.tableOperations().delete(tableName); } // close happens asynchronously. Let the test fail by timeout