Opened 8 years ago

Closed 8 years ago

#1384 closed defect (fixed)

tests after #1217 don't always work

Reported by: jinmei Owned by: jelte
Priority: very high Milestone: Sprint-20111122
Component: data source Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DNS Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 6.25 Internal?: no

Description

See my message on dev-list.
https://lists.isc.org/pipermail/bind10-dev/2011-November/002762.html

We should at least fix the failing (and now disabled) test ASAP.
Since this is a regression of #1217 (which is in the current sprint)
I'm going to push this ticket in the current sprint, too.

Subtickets

Change History (12)

comment:1 Changed 8 years ago by jelte

  • Owner set to jelte
  • Status changed from new to assigned

comment:2 Changed 8 years ago by jelte

I intend to take jinmei's proposal and go with the separate_rr approach again in this ticket too, btw

comment:3 Changed 8 years ago by jelte

  • Owner changed from jelte to UnAssigned
  • Status changed from assigned to reviewing

Okay, changed adjust_ttl to separate_rrs, where no matter what the content each rr is in its own rrset. Implemented it for the in-memory data source as well.

The last commit for this is c2213ce7281be2aed47023a6f052bbec868a6028; the commit after that is a merge of master so that the unit tests are actually run.

comment:4 Changed 8 years ago by jelte

  • Total Hours changed from 0 to 4

comment:5 Changed 8 years ago by vorner

  • Owner changed from UnAssigned to vorner

comment:6 Changed 8 years ago by vorner

  • Owner changed from vorner to jelte

Hello

The code looks OK, but it crashes for me in the InMemoryClientTest?.iterator_separate_rrs test:

Core was generated by `/home/vorner/work/bind10/src/lib/datasrc/tests/.libs/run_unittests_memory'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000442fa7 in isc::datasrc::(anonymous namespace)::MemoryIterator::MemoryIterator (this=0x23cee40, tree=..., origin=..., separate_rrs=true)
    at ../../../../src/lib/datasrc/memory_datasrc.cc:756
756	                    rdata_iterator_ = dom_iterator_->second->getRdataIterator();
(gdb) l
751	        // Initialize the iterator if there's somewhere to point to
752	        if (node_ != NULL && node_->getData() != DomainPtr()) {
753	            dom_iterator_ = node_->getData()->begin();
754	            if (separate_rrs_) {
755	                if (dom_iterator_->second != NULL) {
756	                    rdata_iterator_ = dom_iterator_->second->getRdataIterator();
757	                }
758	            }
759	        }
760	    }
(gdb) print dom_iterator_
$1 = {first = {typecode_ = 0}, second = {px = , pn = {pi_ = }}}
(gdb) bt
#0  0x0000000000442fa7 in isc::datasrc::(anonymous namespace)::MemoryIterator::MemoryIterator (this=0x23cee40, tree=..., origin=..., separate_rrs=true)
    at ../../../../src/lib/datasrc/memory_datasrc.cc:756
#1  0x0000000000443bd9 in isc::datasrc::InMemoryClient::getIterator (this=0x23c5148, name=..., separate_rrs=true)
    at ../../../../src/lib/datasrc/memory_datasrc.cc:847
#2  0x00000000004211f7 in (anonymous namespace)::InMemoryClientTest_iterator_separate_rrs_Test::TestBody (this=0x23c5130) at memory_datasrc_unittest.cc:209
#3  0x00007f7226e09f0a in testing::Test::Run (this=0x23c5130) at src/gtest.cc:2095
#4  0x00007f7226e0a000 in testing::internal::TestInfoImpl::Run (this=0x23c0d10) at src/gtest.cc:2314
#5  0x00007f7226e0a0ac in testing::TestCase::Run (this=0x23c04e0) at src/gtest.cc:2420
#6  0x00007f7226e0a35c in testing::internal::UnitTestImpl::RunAllTests (this=0x23c0890) at src/gtest.cc:4024
#7  0x000000000045062c in isc::util::unittests::run_all () at run_all.cc:87
#8  0x00000000004167c2 in main (argc=1, argv=0x7fff756f0d28) at run_unittests.cc:28
(gdb) print dom_iterator_
$2 = {first = {typecode_ = 0}, second = {px = , pn = {pi_ = }}}
(gdb) print dom_iterator_->second
You can't do that without a process to debug.
(gdb) frame 3
#3  0x00007f7226e09f0a in testing::Test::Run (this=0x23c5130) at src/gtest.cc:2095
2095	    TestBody();
(gdb) l
2090	  SetUp();
2091	
2092	  // We will run the test only if SetUp() was successful.
2093	  if (!HasFatalFailure()) {
2094	    impl->os_stack_trace_getter()->UponLeavingGTest();
2095	    TestBody();
2096	  }
2097	
2098	  // However, we want to clean up as much as possible.  Hence we will
2099	  // always call TearDown(), even if SetUp() or the test body has
(gdb) down
#2  0x00000000004211f7 in (anonymous namespace)::InMemoryClientTest_iterator_separate_rrs_Test::TestBody (this=0x23c5130) at memory_datasrc_unittest.cc:209
209	    ZoneIteratorPtr iterator(memory_client.getIterator(Name("a"), true));
(gdb) l
204	    // First, the zone is not there, so it should throw
205	    EXPECT_THROW(memory_client.getIterator(Name("b"), true), DataSourceError);
206	    // This zone is not there either, even when there's a zone containing this
207	    EXPECT_THROW(memory_client.getIterator(Name("x.a")), DataSourceError);
208	    // Now, an empty zone
209	    ZoneIteratorPtr iterator(memory_client.getIterator(Name("a"), true));
210	    EXPECT_EQ(ConstRRsetPtr(), iterator->getNextRRset());
211	    // It throws Unexpected when we are past the end
212	    EXPECT_THROW(iterator->getNextRRset(), isc::Unexpected);
213	

I guess it doesn't like an empty zone here. Should I look into it, or do you have an idea why it failes?

Thank you

comment:7 Changed 8 years ago by jelte

  • Owner changed from jelte to vorner

No it was a real failure, was checking the wrong value (which happened to work on some systems), please pull update and try again.

comment:8 follow-up: Changed 8 years ago by vorner

  • Owner changed from vorner to jinmei
  • Total Hours changed from 4 to 5.25

This works here, so please merge.

comment:9 in reply to: ↑ 8 Changed 8 years ago by jinmei

Replying to vorner:

This works here, so please merge.

Why was it now assigned to me? Did you perhaps actually mean passing it to jelte?

comment:10 Changed 8 years ago by jinmei

  • Owner changed from jinmei to vorner

comment:11 Changed 8 years ago by vorner

  • Owner changed from vorner to jelte

Ah, of course, my bad. Too many people starting with „J“.

comment:12 Changed 8 years ago by jelte

  • Resolution set to fixed
  • Status changed from reviewing to closed
  • Total Hours changed from 5.25 to 6.25

Thanks, merged, closing

Note: See TracTickets for help on using tickets.