aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_scheduler.c
AgeCommit message (Collapse)Author
2020-01-08It's 2020. Update the copyright dates with "make update-copyright"Nick Mathewson
2019-12-20Replace several C identifiers.teor
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ EXPOSE_CLEAN_BACKTRACE BACKTRACE_PRIVATE \ TOR_CHANNEL_INTERNAL_ CHANNEL_OBJECT_PRIVATE \ CHANNEL_PRIVATE_ CHANNEL_FILE_PRIVATE \ EXPOSE_ROUTERDESC_TOKEN_TABLE ROUTERDESC_TOKEN_TABLE_PRIVATE \ SCHEDULER_PRIVATE_ SCHEDULER_PRIVATE
2019-09-11Run test_operator_cleanup on our unit testsNick Mathewson
Coccinelle doesn't understand it when we use "==" and "!=" and so on as arguments to macros. To solve this, we prefer OP_EQ, OP_NE, and so on. This commit is automatically generated by running ./scripts/coccinelle/test_operator_cleanup over all of the source code in src.
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-07-05Fix every include path changed in the previous commit (automated)Nick Mathewson
I am very glad to have written this script.
2018-07-05Clean up include paths for libtor-evloop (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-04-05Remove redundant event2/event.h usage from test_scheduler.cNick Mathewson
This module doesn't actually need to mock the libevent mainloop at all: it can just use the regular mainloop that the test environment sets up. Part of ticket 23750.
2018-02-02Merge branch 'maint-0.3.2'Nick Mathewson
2018-02-02sched: When releasing a channel, do not BUG() if absent from the pending listDavid Goulet
The current code flow makes it that we can release a channel in a PENDING state but not in the pending list. This happens while the channel is being processed in the scheduler loop. Fixes #25125 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-01test: KIST Scheduler unit tests to test the pending list stateDavid Goulet
This tests many cases of the KIST scheduler with the pending list state by calling entry point in the scheduler while channels are scheduled or not. Also, it adds a test for the bug #24700. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-02-01Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-31ns: Add a before and after consensus has changed notificationDavid Goulet
In 0.3.2.1-alpha, we've added notify_networkstatus_changed() in order to have a way to notify other subsystems that the consensus just changed. The old and new consensus are passed to it. Before this patch, this was done _before_ the new consensus was set globally (thus NOT accessible by getting the latest consensus). The scheduler notification was assuming that it was set and select_scheduler() is looking at the latest consensus to get the parameters it might needs. This was very wrong because at that point it is still the old consensus set globally. This commit changes the notify_networkstatus_changed() to be the "before" function and adds an "after" notification from which the scheduler subsystem is notified. Fixes #24975
2018-01-24Merge branch 'maint-0.3.2'Nick Mathewson
2018-01-24Fix a memory leak in scheduler/loop_kistNick Mathewson
Fixes bug 25005.
2017-12-08Merge branch 'dgoulet_ticket23709_033_01_squashed'Nick Mathewson
2017-12-06test: Add a KIST test for a non opened channelDavid Goulet
This makes sure that a non opened channel is never put back in the channel pending list and that its state is consistent with what we expect that is IDLE. Test the fixes in #24502. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-22test: Fix memleak of channel cmuxDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-22channel: Remove incoming/outgoing queueDavid Goulet
For the rationale, see ticket #23709. This is a pretty massive commit. Those queues were everywhere in channel.c and it turns out that it was used by lots of dead code. The channel subsystem *never* handles variable size cell (var_cell_t) or unpacked cells (cell_t). The variable ones are only handled in channeltls and outbound cells are always packed from the circuit queue so this commit removes code related to variable and unpacked cells. However, inbound cells are unpacked (cell_t), that is untouched and is handled via channel_process_cell() function. In order to make the commit compile, test have been modified but not passing at this commit. Also, many tests have been removed but better improved ones get added in future commits. This commit also adds a XXX: which indicates that the handling process of outbound cells isn't fully working. This as well is fixed in a future commit. Finally, at this commit, more dead code remains, it will be cleanup in future commits. Fixes #23709 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-25sched: Make KISTSchedRunInterval non negativeDavid Goulet
Fixes #23539. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Define SCHEDULER_KIST_PRIVATE for more encapsulationDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15test: Fix unit tests with latest scheduler changesDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Make the scheduler object staticDavid Goulet
Each type of scheduler implements its own static scheduler_t object and returns a reference to it. This commit also makes it a const pointer that is it can only change inside the scheduler type subsystem but not outside for extra protection. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: Add Schedulers torrc optionDavid Goulet
This option is a list of possible scheduler type tor can use ordered by priority. Its default value is "KIST,KISTLite,Vanilla" which means that KIST will be used first and if unavailable will fallback to KISTLite and so on. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-09-15sched: revisist compatibility on non-linux systemsMatt Traudt
Wrap things in HAVE_KIST_SUPPORT until Tor compiles and tests cleanly on my OS X machine.
2017-09-15sched: rename scheduler to the_schedulerMatt Traudt
2017-09-15sched: Implement the KIST schedulerMatt Traudt
Closes #12541 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24apply ahf's test_assert_null.cocciNick Mathewson
2017-08-24Fix operator usage in src/test/*.cAlexander Færøy
This patch fixes the operator usage in src/test/*.c to use the symbolic operators instead of the normal C comparison operators. This patch was generated using: ./scripts/coccinelle/test-operator-cleanup src/test/*.[ch]
2017-06-21Extract channel_do_open_actions() from non-open _change_state casesNick Mathewson
This reduces the size of the largest SCC in the callgraph by 30 functions, from 58 to 28.
2017-03-15Run the copyright update script.Nick Mathewson
2016-09-11Merge remote-tracking branch 'public/solaris_warnings_028'Nick Mathewson
2016-07-28Fix a large pile of solaris warnings for bug 19767.Nick Mathewson
In nearly all cases, this is a matter of making sure that we include orconfig.h before we include any standard c headers.
2016-07-28Merge branch 'bug18902_squashed'Nick Mathewson
2016-07-28Fix all -Wshadow warnings on LinuxNick Mathewson
This is a partial fix for 18902.
2016-07-04Raise libevent dependency to 2.0.10-stable or newerSebastian Hahn
Only some very ancient distributions don't ship with Libevent 2 anymore, even the oldest supported Ubuntu LTS version has it. This allows us to get rid of a lot of compat code.
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-03-22Try to fix an intermittent test failure on openbsd.Nick Mathewson
2016-02-27Update the copyright year.Nick Mathewson
2015-05-29Fix another int-to-ptr cast.Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-28Fix some 32-bit build issues in the testsNick Mathewson
When comparing 64-bit types, you need to use tt_[ui]64_op(). Found by Jenkins
2014-11-27Fix a likely bug found by coverity in test_scheduler.c.Nick Mathewson
Andrea, do you agree with this? This is CID 1256186
2014-09-30Update test_relay.c for recent test suite changes and --enable-mempools supportAndrea Shepard
2014-09-30Add scheduler/loop unit testAndrea Shepard
2014-09-30Add scheduler channel states unit testAndrea Shepard
2014-09-30Add scheduler/compare_channels unit testAndrea Shepard
2014-09-30Add scheduler/queue_heuristic unit testAndrea Shepard
2014-09-30Initial test_scheduler.cAndrea Shepard